func (records Records) dump(btree *Btree) { for key, val := range records { stored := btree.Find([]byte(key)) if bytes.Equal(stored, []byte(val)) { fmt.Println(key, "=", string(stored)) } else { bug.Error(key, "=", string(stored), "!=", val) } } }
func (leaf *Leaf) Insert(key, val []byte) { n := Len(len(key)+len(val)) + LenRec if n > leaf.head.free { bug.Error("Out of space") return } i := leaf.findIndex(key) leaf.storeSlice(val) leaf.storeSlice(key) leaf.storeIndex(i, leaf.head.end) }