You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
m.Items() gives some unexpected results when you add a key with value 0.
This can be fixed by something like this:
// Items returns a channel for iterating all key-value pairs.
func (m *Map) Items() chan [2]int64 {
c := make(chan [2]int64, 10)
go func() {
data := m.data
var k int64
if m.hasFreeKey {
c <- [2]int64{FREE_KEY, m.freeVal}
}
for i := 0; i < len(data); i += 2 {
k = data[i]
if k == FREE_KEY {
continue
}
c <- [2]int64{k, data[i+1]}
}
close(c)
}()
return c
}
The text was updated successfully, but these errors were encountered:
Hi,
m.Items()
gives some unexpected results when you add a key with value 0.This can be fixed by something like this:
The text was updated successfully, but these errors were encountered: