vbt 代码覆盖率75%+ 修改IndexRange的bug

This commit is contained in:
2019-08-04 22:24:51 +08:00
parent 5ef163bca7
commit c2dd82b426
7 changed files with 237 additions and 14 deletions

View File

@@ -1,8 +1,9 @@
package pqueue
import (
"github.com/474420502/focus/compare"
"github.com/davecgh/go-spew/spew"
"github.com/474420502/focus/compare"
)
type Node struct {
@@ -100,9 +101,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
}
}