vbt 代码覆盖率75%+ 修改IndexRange的bug
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package pqueuekey
|
||||
|
||||
import (
|
||||
"github.com/474420502/focus/compare"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"github.com/474420502/focus/compare"
|
||||
)
|
||||
|
||||
type Node struct {
|
||||
@@ -101,9 +102,9 @@ func (tree *vbTree) IndexRange(idx1, idx2 int) (result []interface{}, ok bool) {
|
||||
|
||||
if idx1^idx2 < 0 {
|
||||
if idx1 < 0 {
|
||||
idx1 = tree.root.size + idx1 - 1
|
||||
idx1 = tree.root.size + idx1
|
||||
} else {
|
||||
idx2 = tree.root.size + idx2 - 1
|
||||
idx2 = tree.root.size + idx2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user