Skip to content

Commit

Permalink
chore: remove ahash
Browse files Browse the repository at this point in the history
We don't really have a good reason to use it, so we might as well stick
to the standard `HashMap`.
  • Loading branch information
Stebalien committed Feb 9, 2024
1 parent f4b5f29 commit afde614
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 12 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ wasmtime-runtime = { version = "12.0.2", default-features = false }
# misc
libfuzzer-sys = "0.4"
arbitrary = "1.3.0"
ahash = "0.8.7"
itertools = "0.11.0"
once_cell = "1.18.0"
unsigned-varint = "0.7.2"
Expand Down
1 change: 0 additions & 1 deletion ipld/amt/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = { workspace = true }
arbitrary = { workspace = true, features = ["derive"] }
ahash = { workspace = true }
itertools = { workspace = true }

cid = { workspace = true, features = ["serde-codec", "arb", "std"] }
Expand Down
6 changes: 4 additions & 2 deletions ipld/amt/fuzz/fuzz_targets/equivalence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// SPDX-License-Identifier: Apache-2.0, MIT

#![no_main]
use std::collections::HashMap;

use arbitrary::Arbitrary;
use cid::Cid;
use fvm_ipld_amt::Amt;
Expand All @@ -22,10 +24,10 @@ enum Method {
Remove,
Get,
}
fn execute(ops: Vec<Operation>) -> (Cid, ahash::AHashMap<u64, u64>) {
fn execute(ops: Vec<Operation>) -> (Cid, HashMap<u64, u64>) {
let db = fvm_ipld_blockstore::MemoryBlockstore::default();
let mut amt = Amt::new(&db);
let mut elements = ahash::AHashMap::new();
let mut elements = HashMap::new();

for (i, Operation { idx, method, flush }) in ops.into_iter().enumerate() {
let idx = idx as u64;
Expand Down
1 change: 0 additions & 1 deletion ipld/hamt/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = { workspace = true }
arbitrary = { workspace = true, features = ["derive"] }
ahash = { workspace = true }

fvm_ipld_hamt = { workspace = true }
fvm_ipld_blockstore = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion ipld/hamt/fuzz/fuzz_targets/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use std::collections::HashMap;

use arbitrary::Arbitrary;
use fvm_ipld_hamt::{Config, Hamt};

Expand All @@ -21,7 +23,7 @@ pub enum Method {
pub fn run(flush_rate: u8, operations: Vec<Operation>, conf: Config) {
let db = fvm_ipld_blockstore::MemoryBlockstore::default();
let mut hamt = Hamt::<_, _, _>::new_with_config(&db, conf);
let mut elements = ahash::AHashMap::new();
let mut elements = HashMap::new();

let flush_rate = (flush_rate as usize).saturating_add(5);
for (i, Operation { key, method }) in operations.into_iter().enumerate() {
Expand Down
1 change: 0 additions & 1 deletion ipld/kamt/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = { workspace = true }
arbitrary = { workspace = true, features = ["derive"] }
ahash = { workspace = true }

fvm_ipld_kamt = { workspace = true }
fvm_ipld_blockstore = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion ipld/kamt/fuzz/fuzz_targets/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use std::collections::HashMap;

use arbitrary::Arbitrary;
use fvm_ipld_kamt::id::Identity;
use fvm_ipld_kamt::{Config, Kamt};
Expand All @@ -22,7 +24,7 @@ pub enum Method {
pub fn run(flush_rate: u8, operations: Vec<Operation>, conf: Config) {
let db = fvm_ipld_blockstore::MemoryBlockstore::default();
let mut kamt = Kamt::<_, u64, u64, Identity>::new_with_config(&db, conf);
let mut elements = ahash::AHashMap::new();
let mut elements = HashMap::new();

let flush_rate = (flush_rate as usize).saturating_add(5);
for (i, Operation { key, method }) in operations.into_iter().enumerate() {
Expand Down

0 comments on commit afde614

Please sign in to comment.