Remove cropping on pow of two the kvs for AddBatch

- Remove cropping on power of two the kvs for AddBatch
  - As not needed to be power of two length with the Virtual Tree
- Fix keyValuesToKvs keyPath
This commit is contained in:
2021-05-19 12:58:11 +02:00
parent 03bb9f7447
commit 13378d338e
4 changed files with 27 additions and 62 deletions

View File

@@ -668,13 +668,14 @@ func TestAddBatchCaseE(t *testing.T) {
c.Check(tree2.Root(), qt.DeepEquals, tree1.Root())
}
func TestHighestPowerOfTwo(t *testing.T) {
func TestFlp2(t *testing.T) {
c := qt.New(t)
c.Assert(highestPowerOfTwo(31), qt.Equals, 16)
c.Assert(highestPowerOfTwo(32), qt.Equals, 32)
c.Assert(highestPowerOfTwo(33), qt.Equals, 32)
c.Assert(highestPowerOfTwo(63), qt.Equals, 32)
c.Assert(highestPowerOfTwo(64), qt.Equals, 64)
c.Assert(flp2(31), qt.Equals, 16)
c.Assert(flp2(32), qt.Equals, 32)
c.Assert(flp2(33), qt.Equals, 32)
c.Assert(flp2(63), qt.Equals, 32)
c.Assert(flp2(64), qt.Equals, 64)
c.Assert(flp2(9000), qt.Equals, 8192)
}
// func printLeafs(name string, t *Tree) {