hash: move dummy map initialisation into an `fn init(){}`, so users do not have to do it explicitly to be compatible with -skip-unused
parent
0f09228adb
commit
afb7168a64
|
@ -6,9 +6,6 @@ import rand
|
||||||
import benchmark
|
import benchmark
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
_ := map{
|
|
||||||
1: 1
|
|
||||||
}
|
|
||||||
rand.seed([u32(42), 0])
|
rand.seed([u32(42), 0])
|
||||||
sample_size := 10000000
|
sample_size := 10000000
|
||||||
min_str_len := 20
|
min_str_len := 20
|
||||||
|
|
|
@ -4,9 +4,6 @@ import os
|
||||||
import v.vcache
|
import v.vcache
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
_ := map{
|
|
||||||
1: 1
|
|
||||||
}
|
|
||||||
mut cm := vcache.new_cache_manager([])
|
mut cm := vcache.new_cache_manager([])
|
||||||
cpath := cm.basepath
|
cpath := cm.basepath
|
||||||
if os.exists(cpath) && os.is_dir(cpath) {
|
if os.exists(cpath) && os.is_dir(cpath) {
|
||||||
|
|
|
@ -6,6 +6,12 @@ fn C.wyhash(&byte, u64, u64, &u64) u64
|
||||||
|
|
||||||
fn C.wyhash64(u64, u64) u64
|
fn C.wyhash64(u64, u64) u64
|
||||||
|
|
||||||
|
fn init() {
|
||||||
|
_ := map{
|
||||||
|
1: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[inline]
|
[inline]
|
||||||
pub fn wyhash_c(key &byte, len u64, seed u64) u64 {
|
pub fn wyhash_c(key &byte, len u64, seed u64) u64 {
|
||||||
return C.wyhash(key, len, seed, &u64(C._wyp))
|
return C.wyhash(key, len, seed, &u64(C._wyp))
|
||||||
|
|
Loading…
Reference in New Issue