修转后的高度修正不正确

This commit is contained in:
2019-03-14 05:23:12 +08:00
parent b7e6045064
commit b435fa1221
4 changed files with 745 additions and 706 deletions

View File

@@ -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)
}
}
}