fix shared •HashMap value list
This commit is contained in:
parent
9c05b68870
commit
2ce983041c
@ -738,7 +738,7 @@ void hashmap_set(B* vars, B w, B x) {
|
||||
B* keys = harr_ptr(vars[0]);
|
||||
HASHMAP_INSERT(
|
||||
w,
|
||||
B* s = harr_ptr(vars[1])+i; dec(*s); dec(w); *s=x; return;
|
||||
B vs = vars[1]; if (!reusable(vs)) vars[1] = vs = taga(cpyHArr(vs)); B* s = harr_ptr(vs)+i; dec(*s); dec(w); *s=x; return;
|
||||
)
|
||||
map->pop++;
|
||||
if (map->pop>>(64-3-sh)>7 || je==map->sz-1) { // keep load <= 7/8
|
||||
|
||||
@ -59,3 +59,5 @@ a←(•ParseFloat¨ "1.2"‿"-0"‿"0")∾-⊸⋈0÷0 ⋄ ! (0‿3‿3‿3⊏a)
|
||||
!"•HashMap: 𝕨 contained duplicate keys" % "strs" •HashMap "stri"
|
||||
!"(hashmap).Get: key not found" % ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Get "fg"
|
||||
!"(hashmap).Delete: key not found" % ("abc"‿"de"‿"fgh" •HashMap ⥊¨↕3).Delete 'a'
|
||||
m ← 1‿2 •HashMap v←•internal.Unshare 'a'‿4 ⋄ 1 m.Set 9 ⋄ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩
|
||||
m ← 1‿2 •HashMap •internal.Unshare 'a'‿4 ⋄ v←m.Values@ ⋄ 1 m.Set 9 ⋄ ⟨v, m.Keys@, m.Values@⟩ %% ⟨'a'‿4, 1‿2, 9‿4⟩
|
||||
Loading…
Reference in New Issue
Block a user