diff --git a/vlib/hash/wyhash.c.v b/vlib/hash/wyhash.c.v index 3f93d245d2..9fc4b06c5e 100644 --- a/vlib/hash/wyhash.c.v +++ b/vlib/hash/wyhash.c.v @@ -6,12 +6,6 @@ fn C.wyhash(&byte, u64, u64, &u64) u64 fn C.wyhash64(u64, u64) u64 -fn init() { - _ := { - 1: 1 - } -} - [inline] pub fn wyhash_c(key &byte, len u64, seed u64) u64 { return C.wyhash(key, len, seed, &u64(C._wyp)) diff --git a/vlib/v/markused/walker.v b/vlib/v/markused/walker.v index e835185fe5..6089d44a88 100644 --- a/vlib/v/markused/walker.v +++ b/vlib/v/markused/walker.v @@ -358,6 +358,10 @@ fn (mut w Walker) expr(node ast.Expr) { if ifield.has_default_expr { w.expr(ifield.default_expr) } + fsym := w.table.get_type_symbol(ifield.typ) + if fsym.kind == .map { + w.table.used_maps++ + } } } if node.has_update_expr { @@ -429,6 +433,9 @@ pub fn (mut w Walker) call_expr(mut node ast.CallExpr) { w.expr(arg.expr) } if node.language == .c { + if node.name in ['C.wyhash', 'C.wyhash64'] { + w.table.used_maps++ + } return } w.expr(node.left)