builtin: remove `import hash`

pull/10065/head
Delyan Angelov 2021-05-10 09:22:50 +03:00
parent 4728d102d9
commit 159ee00563
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 9 additions and 8 deletions

View File

@ -3,8 +3,9 @@
// that can be found in the LICENSE file.
module builtin
// import hash.wyhash as hash
import hash
fn C.wyhash(&byte, u64, u64, &u64) u64
fn C.wyhash64(u64, u64) u64
/*
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 {
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 {
return hash.wyhash64_c(*unsafe { &byte(pkey) }, 0)
return C.wyhash64(*unsafe { &byte(pkey) }, 0)
}
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 {
return hash.wyhash64_c(*unsafe { &u32(pkey) }, 0)
return C.wyhash64(*unsafe { &u32(pkey) }, 0)
}
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 {

View File

@ -15,7 +15,7 @@ pub const (
// math.bits is needed by strconv.ftoa
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']
)