chaokunyang commented on code in PR #2769:
URL: https://github.com/apache/fory/pull/2769#discussion_r2430960019


##########
rust/fory-core/src/resolver/metastring_resolver.rs:
##########
@@ -130,48 +133,46 @@ impl MetaStringWriterResolver {
         }
     }
 
-    pub fn get_or_create_meta_string_bytes(&mut self, m: &MetaString) -> 
MetaStringBytes {
-        if let Some(b) = self.meta_string_to_bytes.get(m) {
-            return b.clone();
-        }
-        let bytes = m.bytes.to_vec();
-        let hash_code = murmurhash3_x64_128(&bytes, 47).0 as i64;
-        let encoding = m.encoding;
-        let mut first8: u64 = 0;
-        let mut second8: u64 = 0;
-        for (i, b) in bytes.iter().take(8).enumerate() {
-            first8 |= (*b as u64) << (8 * i);
-        }
-        if bytes.len() > 8 {
-            for j in 0..usize::min(8, bytes.len() - 8) {
-                second8 |= (bytes[8 + j] as u64) << (8 * j);
-            }
+    #[allow(clippy::arc_with_non_send_sync)]
+    pub fn get_or_create_meta_string_bytes(

Review Comment:
   could we return `Result<&MetaStringBytes>, Error>` instead? Using `RefCell` 
is not idiomatic in rust, we should use it sparely



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to