align with new @hide syntax
This commit is contained in:
@@ -132,7 +132,8 @@ put proc(
|
||||
}
|
||||
}
|
||||
|
||||
hide normalize proc(hash usize) usize {
|
||||
@hide
|
||||
normalize proc(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
|
||||
@@ -141,7 +142,8 @@ hide normalize proc(hash usize) usize {
|
||||
|
||||
#! FNV-1a hash implementation.
|
||||
#! note: vulnerable to collision attacks.
|
||||
hide str_hash proc(key []u8) usize {
|
||||
@hide
|
||||
str_hash proc(key []u8) usize {
|
||||
hash u32 := 2166136261 # offset basis
|
||||
prime u32 := 16777619
|
||||
|
||||
@@ -153,4 +155,5 @@ hide str_hash proc(key []u8) usize {
|
||||
return usize(hash)
|
||||
}
|
||||
|
||||
hide str_eql proc(a, b []u8) bool { return mem.eql(a, b) }
|
||||
@hide
|
||||
str_eql proc(a, b []u8) bool { return mem.eql(a, b) }
|
||||
|
||||
Reference in New Issue
Block a user