mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
handle insertions correctly
The "Update" case for Slice containers is broken, and can insert a container without inserting a key. Fix this by using the existing insert/add logic.
This commit is contained in:
parent
bbb5766bc0
commit
089e7e127e
1 changed files with 1 additions and 3 deletions
|
|
@ -196,9 +196,7 @@ func (sc *sliceContainers) Update(key uint64, fn func(*Container, bool) (*Contai
|
|||
// don't expand the slice just to add a nil container, we
|
||||
// could return that anyway
|
||||
if write && nc != nil {
|
||||
sc.containers = append(sc.containers, nil)
|
||||
copy(sc.containers[i+1:], sc.containers[i:])
|
||||
sc.containers[i] = nc
|
||||
sc.insertAt(key, nc, -i-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue