Skip to content

Commit

Permalink
Fixed BoundedDelete counter
Browse files Browse the repository at this point in the history
  • Loading branch information
umpc committed Jul 21, 2017
1 parent 39a7c59 commit b9a2b80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ func (sm *SortedMap) boundedDelete(lowerBound, upperBound interface{}) error {
if iterBounds == nil {
return errors.New(noValuesErr)
}
for i := iterBounds[0]; i <= iterBounds[1]-i; i++ {
for i, deleted := iterBounds[0], 0; i <= iterBounds[1]-deleted; i++ {
delete(sm.idx, sm.sorted[i])
sm.sorted = deleteInterface(sm.sorted, i)
deleted++
}
return nil
}
Expand Down

0 comments on commit b9a2b80

Please sign in to comment.