From d6986b78a5a949464e1484d4dc072872636dc98d Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Mon, 13 Jul 2020 20:08:22 -0500 Subject: [PATCH] . --- rbf/array.go | 14 ++++++++++++++ rbf/cursor_test.go | 4 ++++ rbf/rbf.go | 14 +------------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/rbf/array.go b/rbf/array.go index 7c4aa3252..743bff525 100644 --- a/rbf/array.go +++ b/rbf/array.go @@ -1,3 +1,17 @@ +// Copyright 2017 Pilosa Corp. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package rbf import ( diff --git a/rbf/cursor_test.go b/rbf/cursor_test.go index f5f206e2a..f2572c2a0 100644 --- a/rbf/cursor_test.go +++ b/rbf/cursor_test.go @@ -939,6 +939,10 @@ func TestCursor_SplitBranchCells(t *testing.T) { } // adding one more container should split it tx.AddRoaring("x", rb(uint64(numContainers))) + c, _ := tx.Cursor("x") + c.First() + c.Dump("test.dot") + after := &EasyWalker{tx: tx} rbf.Page(tx, 0, after) if after.String() != "RBLL" { diff --git a/rbf/rbf.go b/rbf/rbf.go index c6b240604..3b608c966 100644 --- a/rbf/rbf.go +++ b/rbf/rbf.go @@ -161,11 +161,7 @@ func dataOffset(n int) int { } func IsBitmapHeader(page []byte) bool { - if readFlags(page) != PageTypeBitmapHeader { - return false - } - // TODO(BBJ): Verify checksum. - return true + return readFlags(page) == PageTypeBitmapHeader } type RootRecord struct { @@ -255,14 +251,6 @@ type leafArgs leafCell func (c *leafCell) Size() int { return leafCellHeaderSize + len(c.Data) } -func (c *leafCell) GetBitmap(tx *Tx) (pgno uint32, bm []uint64, err error) { - pgno = toPgno(c.Data) - page, err := tx.readPage(pgno) - if err != nil { - return 0, nil, err - } - return pgno, toArray64(page), err -} // Bitmap returns a bitmap representation of the cell data. func (c *leafCell) Bitmap(tx *Tx) []uint64 {