Comments (3)
You can keep the hasher outside the map and use ()
as the hasher in the map.
from hashbrown.
That sounds good, I would be happy to accept a PR which adds a new method to RawVacantEntryMut
that allows passing in a hasher function like RawTable
does.
You should be able to make it so that the dummy Hash
implementation is not required at all.
from hashbrown.
I've run into a hitch with insert_with_hasher
: I would still like access to the hasher of the map, so I can hash with the configured hasher.
Specifically, I'd like an adjustment from
pub fn RawVacantEntryMut::insert_with_hasher<H>(
self,
hash: u64,
key: K,
value: V,
hasher: H,
) -> (&'a mut K, &'a mut V)
where
H: Fn(&K) -> u64,
to
pub fn RawVacantEntryMut::insert_with_hasher<H>(
self,
hash: u64,
key: K,
value: V,
hasher: H,
) -> (&'a mut K, &'a mut V)
where
H: Fn(&K, &S) -> u64,
The impl I'm doing is an interner that requires information outside of the hashmap to properly hash the keys. [gist]
(While we're (potentially) touching the function API, is there a reason for it to take Fn
rather than FnMut
?)
from hashbrown.
Related Issues (20)
- Hashbrown crash due to bad malloc HOT 1
- 0.14.3 - no method named `clear` found for struct `HashMap` in the current scope HOT 5
- Benchmark biaised due to no fence around input
- assertion failed: buckets.is_power_of_two() HOT 8
- Build breaks on nightly due to use of `stdsimd` rust feature in ahash 0.8.6 HOT 2
- Was swap-remove behavior ever considered when removing entries? HOT 10
- Consider returning to 1.63.0 MSRV HOT 1
- How to calculate the size of the hashbrown::HashMap at runtime? HOT 2
- LLVM failed to use the knowledge from a never-overflow assumption HOT 13
- Library test `map::test_map::test_clone_from_memory_leaks` errors with using uninitialized data under valgrind and miri
- update to ahash 0.8.7 or after to use new stdsimd feature portable_simd HOT 1
- Insertion performance with arena allocators HOT 3
- Do not grow the raw table when lots of deletion and insertion is performed HOT 3
- Unsound usages of unsafe implementation from `usize` to `T` HOT 8
- Support lower maximum size HOT 1
- Compiler cant hoist following branch out of loop HOT 2
- Refactoring proposal: cleaning up the internal APIs HOT 5
- Memory leak HOT 1
- segfault at HashMap.get HOT 4
- Missing `Clone` implementation for `hash_table::Iter`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hashbrown.