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:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user