MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / hash

Method hash

code/chapter05/hashmap.rs:24–26  ·  view source on GitHub ↗
(&self, key: usize)

Source from the content-addressed store, hash-verified

22 }
23
24 fn hash(&self, key: usize) -> usize {
25 key % self.size
26 }
27
28 fn rehash(&self, pos: usize) -> usize {
29 (pos + 1) % self.size

Callers 6

insertMethod · 0.45
removeMethod · 0.45
getMethod · 0.45
hashFunction · 0.45
make_hashMethod · 0.45
get_hashMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected