Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
762f2161
Commit
762f2161
authored
Oct 04, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/zodb/btree: Cosmetics
parent
e7bea476
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
go/zodb/btree/btree.go.in
go/zodb/btree/btree.go.in
+3
-3
go/zodb/btree/testdata/gen-testdata
go/zodb/btree/testdata/gen-testdata
+0
-1
go/zodb/btree/ziobtree.go
go/zodb/btree/ziobtree.go
+3
-3
go/zodb/btree/zlobtree.go
go/zodb/btree/zlobtree.go
+3
-3
No files found.
go/zodb/btree/btree.go.in
View file @
762f2161
...
@@ -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
,
wh
o
is
either
BTree
or
Bucket
.
//
It
contains
key
and
child
,
wh
ich
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]}
...
...
go/zodb/btree/testdata/gen-testdata
View file @
762f2161
...
@@ -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{"
\
...
...
go/zodb/btree/ziobtree.go
View file @
762f2161
...
@@ -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, wh
o
is either IOBTree or IOBucket.
// It contains key and child, wh
ich
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
]}
...
...
go/zodb/btree/zlobtree.go
View file @
762f2161
...
@@ -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, wh
o
is either LOBTree or LOBucket.
// It contains key and child, wh
ich
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
]}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment