mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-16 07:48:20 +00:00
Recsplit: collision typed error (#150)
This commit is contained in:
parent
138a208431
commit
f6b0a0c969
@ -30,6 +30,8 @@ import (
|
||||
"github.com/spaolacci/murmur3"
|
||||
)
|
||||
|
||||
var ErrCollision = fmt.Errorf("duplicate key")
|
||||
|
||||
const RecSplitLogPrefix = "recsplit"
|
||||
|
||||
const MaxLeafSize = 24
|
||||
@ -298,7 +300,7 @@ func (rs *RecSplit) recsplitCurrentBucket() error {
|
||||
for i, key := range rs.currentBucket[1:] {
|
||||
if key == rs.currentBucket[i] {
|
||||
rs.collision = true
|
||||
return fmt.Errorf("duplicate key %x", key)
|
||||
return fmt.Errorf("%w: %x", ErrCollision, key)
|
||||
}
|
||||
}
|
||||
bitPos := rs.gr.bitCount
|
||||
|
Loading…
Reference in New Issue
Block a user