修转后的高度修正不正确
This commit is contained in:
@@ -3,6 +3,7 @@ package plist
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Pallinder/go-randomdata"
|
||||
"github.com/emirpasic/gods/utils"
|
||||
)
|
||||
|
||||
@@ -146,3 +147,23 @@ func TestRemove(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func BenchmarkInsert(b *testing.B) {
|
||||
pl := New(utils.IntComparator)
|
||||
|
||||
b.N = 3000
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
v := randomdata.Number(0, 65535)
|
||||
pl.Push(v)
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
b.StartTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if i%2 == 0 {
|
||||
pl.Get(i)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user