Commit 1d55685e authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: minor cleanup of hashmap code

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11357043
parent 9bd32b48
...@@ -610,7 +610,7 @@ hash_insert(MapType *t, Hmap *h, void *key, void *value) ...@@ -610,7 +610,7 @@ hash_insert(MapType *t, Hmap *h, void *key, void *value)
top = hash >> (sizeof(uintptr)*8 - 8); top = hash >> (sizeof(uintptr)*8 - 8);
if(top == 0) if(top == 0)
top = 1; top = 1;
inserti = 0; inserti = nil;
insertk = nil; insertk = nil;
insertv = nil; insertv = nil;
while(true) { while(true) {
...@@ -1485,12 +1485,8 @@ reflect·mapiterkey(struct hash_iter *it, uintptr key, bool ok) ...@@ -1485,12 +1485,8 @@ reflect·mapiterkey(struct hash_iter *it, uintptr key, bool ok)
key = 0; key = 0;
ok = false; ok = false;
res = it->key; res = it->key;
if(res == nil) { if(res != nil) {
key = 0;
ok = false;
} else {
tkey = it->t->key; tkey = it->t->key;
key = 0;
if(tkey->size <= sizeof(key)) if(tkey->size <= sizeof(key))
tkey->alg->copy(tkey->size, (byte*)&key, res); tkey->alg->copy(tkey->size, (byte*)&key, res);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment