v.markused: remove `hash.init()` function (map fn usages are detected more precisely)
parent
b52f79e137
commit
79e33d92f1
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue