1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v2: xor, for x = ...

This commit is contained in:
Alexander Medvednikov
2020-02-20 20:30:34 +01:00
parent c85ccad0a6
commit e56bf42270
3 changed files with 9 additions and 3 deletions

View File

@@ -108,7 +108,10 @@ fn (m mut map) set(key string, value voidptr) {
// Match is not possible anymore.
// Probe until an empty index is found.
// Swap when probe count is higher/richer (Robin Hood).
mut current_kv := KeyValue{key, malloc(m.value_bytes)}
mut current_kv := KeyValue{
key:key
value:malloc(m.value_bytes)
}
C.memcpy(current_kv.value, value, m.value_bytes)
for m.probe_hash[index] != 0 {
if probe_hash > m.probe_hash[index] {
@@ -371,4 +374,4 @@ pub fn (m map_string) str() string {
}
sb.writeln('}')
return sb.str()
}
}