builtin: remove `import hash`
parent
4728d102d9
commit
159ee00563
|
@ -3,8 +3,9 @@
|
||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
module builtin
|
module builtin
|
||||||
|
|
||||||
// import hash.wyhash as hash
|
fn C.wyhash(&byte, u64, u64, &u64) u64
|
||||||
import hash
|
|
||||||
|
fn C.wyhash64(u64, u64) u64
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This is a highly optimized hashmap implementation. It has several traits that
|
This is a highly optimized hashmap implementation. It has several traits that
|
||||||
|
@ -247,23 +248,23 @@ pub mut:
|
||||||
|
|
||||||
fn map_hash_string(pkey voidptr) u64 {
|
fn map_hash_string(pkey voidptr) u64 {
|
||||||
key := *unsafe { &string(pkey) }
|
key := *unsafe { &string(pkey) }
|
||||||
return hash.wyhash_c(key.str, u64(key.len), 0)
|
return C.wyhash(key.str, u64(key.len), 0, &u64(C._wyp))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map_hash_int_1(pkey voidptr) u64 {
|
fn map_hash_int_1(pkey voidptr) u64 {
|
||||||
return hash.wyhash64_c(*unsafe { &byte(pkey) }, 0)
|
return C.wyhash64(*unsafe { &byte(pkey) }, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map_hash_int_2(pkey voidptr) u64 {
|
fn map_hash_int_2(pkey voidptr) u64 {
|
||||||
return hash.wyhash64_c(*unsafe { &u16(pkey) }, 0)
|
return C.wyhash64(*unsafe { &u16(pkey) }, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map_hash_int_4(pkey voidptr) u64 {
|
fn map_hash_int_4(pkey voidptr) u64 {
|
||||||
return hash.wyhash64_c(*unsafe { &u32(pkey) }, 0)
|
return C.wyhash64(*unsafe { &u32(pkey) }, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map_hash_int_8(pkey voidptr) u64 {
|
fn map_hash_int_8(pkey voidptr) u64 {
|
||||||
return hash.wyhash64_c(*unsafe { &u64(pkey) }, 0)
|
return C.wyhash64(*unsafe { &u64(pkey) }, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn map_eq_string(a voidptr, b voidptr) bool {
|
fn map_eq_string(a voidptr, b voidptr) bool {
|
||||||
|
|
|
@ -15,7 +15,7 @@ pub const (
|
||||||
|
|
||||||
// math.bits is needed by strconv.ftoa
|
// math.bits is needed by strconv.ftoa
|
||||||
pub const (
|
pub const (
|
||||||
builtin_module_parts = ['math.bits', 'strconv', 'strconv.ftoa', 'hash', 'strings', 'builtin']
|
builtin_module_parts = ['math.bits', 'strconv', 'strconv.ftoa', 'strings', 'builtin']
|
||||||
bundle_modules = ['clipboard', 'fontstash', 'gg', 'gx', 'sokol', 'szip', 'ui']
|
bundle_modules = ['clipboard', 'fontstash', 'gg', 'gx', 'sokol', 'szip', 'ui']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue