Commit 762f2161 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/btree: Cosmetics

parent e7bea476
...@@ -65,7 +65,7 @@ type BTree struct { ...@@ -65,7 +65,7 @@ type BTree struct {
// Entry is one BTree node entry. // Entry is one BTree node entry.
// //
// It contains key and child, who is either BTree or Bucket. // It contains key and child, which is either BTree or Bucket.
// //
// Key limits child's keys - see BTree.Entryv for details. // Key limits child's keys - see BTree.Entryv for details.
type Entry struct { type Entry struct {
...@@ -123,7 +123,7 @@ func (e *Entry) Child() Node { return e.child } ...@@ -123,7 +123,7 @@ func (e *Entry) Child() Node { return e.child }
// Children of all entries are guaranteed to be of the same kind - either all BTree, or all Bucket. // Children of all entries are guaranteed to be of the same kind - either all BTree, or all Bucket.
// //
// The caller must not modify returned array. // The caller must not modify returned array.
func (t *BTree) Entryv() []Entry { func (t *BTree) Entryv() /*readonly*/ []Entry {
return t.data return t.data
} }
...@@ -134,7 +134,7 @@ func (e *BucketEntry) Key() KEY { return e.key } ...@@ -134,7 +134,7 @@ func (e *BucketEntry) Key() KEY { return e.key }
func (e *BucketEntry) Value() interface{} { return e.value } func (e *BucketEntry) Value() interface{} { return e.value }
// Entryv returns entries of a Bucket node. // Entryv returns entries of a Bucket node.
func (b *Bucket) Entryv() []BucketEntry { func (b *Bucket) Entryv() /*readonly*/ []BucketEntry {
ev := make([]BucketEntry, len(b.keys)) ev := make([]BucketEntry, len(b.keys))
for i, k := range b.keys { for i, k := range b.keys {
ev[i] = BucketEntry{k, b.values[i]} ev[i] = BucketEntry{k, b.values[i]}
......
...@@ -59,7 +59,6 @@ def main2(): ...@@ -59,7 +59,6 @@ def main2():
print >>f, v print >>f, v
emit("// Code generated by %s; DO NOT EDIT." % __file__) emit("// Code generated by %s; DO NOT EDIT." % __file__)
emit("package btree\n") emit("package btree\n")
#emit("import \"lab.nexedi.com/kirr/neo/go/zodb\"\n")
def emititems(b): def emititems(b):
s = "testEntry{oid: %s, kind: %s, itemv: []kv{" \ s = "testEntry{oid: %s, kind: %s, itemv: []kv{" \
......
...@@ -67,7 +67,7 @@ type IOBTree struct { ...@@ -67,7 +67,7 @@ type IOBTree struct {
// IOEntry is one IOBTree node entry. // IOEntry is one IOBTree node entry.
// //
// It contains key and child, who is either IOBTree or IOBucket. // It contains key and child, which is either IOBTree or IOBucket.
// //
// Key limits child's keys - see IOBTree.Entryv for details. // Key limits child's keys - see IOBTree.Entryv for details.
type IOEntry struct { type IOEntry struct {
...@@ -125,7 +125,7 @@ func (e *IOEntry) Child() IONode { return e.child } ...@@ -125,7 +125,7 @@ func (e *IOEntry) Child() IONode { return e.child }
// Children of all entries are guaranteed to be of the same kind - either all IOBTree, or all IOBucket. // Children of all entries are guaranteed to be of the same kind - either all IOBTree, or all IOBucket.
// //
// The caller must not modify returned array. // The caller must not modify returned array.
func (t *IOBTree) Entryv() []IOEntry { func (t *IOBTree) Entryv() /*readonly*/ []IOEntry {
return t.data return t.data
} }
...@@ -136,7 +136,7 @@ func (e *IOBucketEntry) Key() int32 { return e.key } ...@@ -136,7 +136,7 @@ func (e *IOBucketEntry) Key() int32 { return e.key }
func (e *IOBucketEntry) Value() interface{} { return e.value } func (e *IOBucketEntry) Value() interface{} { return e.value }
// Entryv returns entries of a IOBucket node. // Entryv returns entries of a IOBucket node.
func (b *IOBucket) Entryv() []IOBucketEntry { func (b *IOBucket) Entryv() /*readonly*/ []IOBucketEntry {
ev := make([]IOBucketEntry, len(b.keys)) ev := make([]IOBucketEntry, len(b.keys))
for i, k := range b.keys { for i, k := range b.keys {
ev[i] = IOBucketEntry{k, b.values[i]} ev[i] = IOBucketEntry{k, b.values[i]}
......
...@@ -67,7 +67,7 @@ type LOBTree struct { ...@@ -67,7 +67,7 @@ type LOBTree struct {
// LOEntry is one LOBTree node entry. // LOEntry is one LOBTree node entry.
// //
// It contains key and child, who is either LOBTree or LOBucket. // It contains key and child, which is either LOBTree or LOBucket.
// //
// Key limits child's keys - see LOBTree.Entryv for details. // Key limits child's keys - see LOBTree.Entryv for details.
type LOEntry struct { type LOEntry struct {
...@@ -125,7 +125,7 @@ func (e *LOEntry) Child() LONode { return e.child } ...@@ -125,7 +125,7 @@ func (e *LOEntry) Child() LONode { return e.child }
// Children of all entries are guaranteed to be of the same kind - either all LOBTree, or all LOBucket. // Children of all entries are guaranteed to be of the same kind - either all LOBTree, or all LOBucket.
// //
// The caller must not modify returned array. // The caller must not modify returned array.
func (t *LOBTree) Entryv() []LOEntry { func (t *LOBTree) Entryv() /*readonly*/ []LOEntry {
return t.data return t.data
} }
...@@ -136,7 +136,7 @@ func (e *LOBucketEntry) Key() int64 { return e.key } ...@@ -136,7 +136,7 @@ func (e *LOBucketEntry) Key() int64 { return e.key }
func (e *LOBucketEntry) Value() interface{} { return e.value } func (e *LOBucketEntry) Value() interface{} { return e.value }
// Entryv returns entries of a LOBucket node. // Entryv returns entries of a LOBucket node.
func (b *LOBucket) Entryv() []LOBucketEntry { func (b *LOBucket) Entryv() /*readonly*/ []LOBucketEntry {
ev := make([]LOBucketEntry, len(b.keys)) ev := make([]LOBucketEntry, len(b.keys))
for i, k := range b.keys { for i, k := range b.keys {
ev[i] = LOBucketEntry{k, b.values[i]} ev[i] = LOBucketEntry{k, b.values[i]}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment