summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-17 13:15:44 -0700
committerOri Bernstein <ori@eigenstate.org>2015-06-17 13:15:44 -0700
commitedd9a39b5350d707c1e0ff5d171766175a182886 (patch)
tree725cffdf72cc97962bf077cb212bcf3523fb7d1d /libstd
parent78a29fd778b1eb2a6258116a194434452d521a80 (diff)
downloadmc-edd9a39b5350d707c1e0ff5d171766175a182886.tar.gz
Work around bug with labels.
We should really fix this. For now, just do workaround.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/htab.myr22
1 files changed, 12 insertions, 10 deletions
diff --git a/libstd/htab.myr b/libstd/htab.myr
index 3adac8e..c02a94e 100644
--- a/libstd/htab.myr
+++ b/libstd/htab.myr
@@ -76,17 +76,19 @@ generic idx = {ht, k
di = 0
h = hash(ht, k)
i = h & (ht.keys.len - 1)
- while ht.hashes[i] != 0 && !ht.dead[i] && ht.hashes[i] != h
-:searchmore
- di++
- i = (h + di) & (ht.keys.len - 1)
- ;;
+ while true
+ while ht.hashes[i] != 0 && !ht.dead[i] && ht.hashes[i] != h
+ di++
+ i = (h + di) & (ht.keys.len - 1)
+ ;;
- if ht.hashes[i] == 0 || ht.dead[i]
- -> `None
- ;;
- if ht.eq(ht.keys[i], k)
- goto searchmore
+ if ht.hashes[i] == 0 || ht.dead[i]
+ -> `None
+ ;;
+ if ht.eq(ht.keys[i], k)
+ di++
+ i = (h + di) & (ht.keys.len - 1)
+ ;;
;;
-> `Some i
}