move hide behind @ and specify with :
This commit is contained in:
@@ -134,7 +134,7 @@ put func(
|
||||
}
|
||||
}
|
||||
|
||||
hide normalize func(hash usize) usize {
|
||||
@hide normalize func(hash usize) usize {
|
||||
# mapping both 0 and 1 to 1 is safe because equality resolves
|
||||
# collisions (since hash and key must both be equal).
|
||||
if (hash == 0) return 1
|
||||
@@ -143,7 +143,7 @@ hide normalize func(hash usize) usize {
|
||||
|
||||
#! FNV-1a hash implementation.
|
||||
#! note: vulnerable to collision attacks.
|
||||
hide str_hash func(key []u8) usize {
|
||||
@hide str_hash func(key []u8) usize {
|
||||
hash u32 := 2166136261 # offset basis
|
||||
prime u32 := 16777619
|
||||
|
||||
@@ -155,6 +155,6 @@ hide str_hash func(key []u8) usize {
|
||||
return usize(hash)
|
||||
}
|
||||
|
||||
hide str_eql func(a, b []u8) bool {
|
||||
@hide str_eql func(a, b []u8) bool {
|
||||
return mem.eql(a, b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user