Skip to content

Commit

Permalink
fix(java): use ext::hash() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaarf committed Aug 14, 2024
1 parent 39f69cc commit a5502d1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ffi/java/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use jni::{objects::{JClass, JObject, JString, JValueGen}, sys::{jlong, jobject, jstring}, JNIEnv};
use xxhash_rust::xxh3::xxh3_64;

use crate::api::Controller;

Expand Down Expand Up @@ -129,7 +128,6 @@ pub extern "system" fn Java_mp_code_data_TextChange_hash<'local>(
let content: String = env.get_string(&content)
.map(|s| s.into())
.jexcept(&mut env);

let hash = xxh3_64(content.as_bytes());
let hash = crate::ext::hash(content.as_bytes());
i64::from_ne_bytes(hash.to_ne_bytes())
}

0 comments on commit a5502d1

Please sign in to comment.