map: remove old get methods

pull/4237/head
Alexander Medvednikov 2020-04-04 14:22:39 +02:00
parent 46aed151ab
commit 440f1cf4c6
1 changed files with 0 additions and 31 deletions

View File

@ -314,37 +314,6 @@ fn (m mut map) cached_rehash(old_cap u32) {
m.metas = new_meta m.metas = new_meta
} }
fn (m map) get(key string, out voidptr) bool {
mut index,mut meta := m.key_to_index(key)
index,meta = meta_less(m.metas, index, meta)
for meta == m.metas[index] {
kv_index := m.metas[index + 1]
if key == m.key_values.data[kv_index].key {
C.memcpy(out, m.key_values.data[kv_index].value, m.value_bytes)
return true
}
index += 2
meta += probe_inc
}
return false
}
fn (m map) get2(key string) voidptr {
mut index,mut meta := m.key_to_index(key)
index,meta = meta_less(m.metas, index, meta)
for meta == m.metas[index] {
kv_index := m.metas[index + 1]
if key == m.key_values.data[kv_index].key {
out := malloc(m.value_bytes)
C.memcpy(out, m.key_values.data[kv_index].value, m.value_bytes)
return out
}
index += 2
meta += probe_inc
}
return voidptr(0)
}
fn (m map) get3(key string, zero voidptr) voidptr { fn (m map) get3(key string, zero voidptr) voidptr {
mut index,mut meta := m.key_to_index(key) mut index,mut meta := m.key_to_index(key)
index,meta = meta_less(m.metas, index, meta) index,meta = meta_less(m.metas, index, meta)