Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove phf from static files #10259

Merged
merged 15 commits into from
Aug 30, 2024
Prev Previous commit
Next Next commit
rm unused fn
  • Loading branch information
nkysg committed Aug 26, 2024
commit 56abe302211ba9085f523b61e2e3a10cd72fa88a
14 changes: 0 additions & 14 deletions crates/storage/nippy-jar/src/phf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ impl<T: AsRef<[u8]> + Sync + Clone + Hash> PHFKey for T {}
pub struct DummyFunction {
map: HashMap<Vec<u8>, usize>,
}
#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct DummyGoFunction {
pub(crate) map: HashMap<Vec<u8>, usize>,
}

impl<T: PHFKey> From<&[T]> for DummyFunction {
fn from(keys: &[T]) -> Self {
Expand All @@ -34,16 +30,6 @@ impl DummyFunction {
}
}

impl<T: PHFKey> From<&[T]> for DummyGoFunction {
fn from(keys: &[T]) -> Self {
let mut map = HashMap::new();
for (i, key) in keys.iter().enumerate() {
map.insert(key.as_ref().to_vec(), i);
}
Self { map }
}
}

/// Trait to build and query a perfect hashing function.
pub trait PerfectHashingFunction: Serialize + for<'a> Deserialize<'a> {
/// Adds the key set and builds the perfect hashing function.
Expand Down