Commit 07869c01 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/btree: Minor cosmetics

- Refer to zodb interfaces as zodb.<name>;
- in tests bmapping is about LOBTree, not BTree. This fixes up c1ba9a90
  (go/zodb/btree: Turn it into template).
parent e5354e76
// Copyright (c) 2001, 2002 Zope Foundation and Contributors. // Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved. // All Rights Reserved.
// //
// Copyright (C) 2018 Nexedi SA and Contributors. // Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This software is subject to the provisions of the Zope Public License, // This software is subject to the provisions of the Zope Public License,
...@@ -229,14 +229,14 @@ func (b *Bucket) get(key KEY) (interface{}, bool) { ...@@ -229,14 +229,14 @@ func (b *Bucket) get(key KEY) (interface{}, bool) {
type bucketState Bucket // hide state methods from public API type bucketState Bucket // hide state methods from public API
// DropState implements Stateful to discard bucket state. // DropState implements zodb.Stateful to discard bucket state.
func (b *bucketState) DropState() { func (b *bucketState) DropState() {
b.next = nil b.next = nil
b.keys = nil b.keys = nil
b.values = nil b.values = nil
} }
// PySetState implements PyStateful to set bucket data from pystate. // PySetState implements zodb.PyStateful to set bucket data from pystate.
func (b *bucketState) PySetState(pystate interface{}) (err error) { func (b *bucketState) PySetState(pystate interface{}) (err error) {
t, ok := pystate.(pickle.Tuple) t, ok := pystate.(pickle.Tuple)
if !ok { if !ok {
......
// Copyright (C) 2018 Nexedi SA and Contributors. // Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -50,7 +50,7 @@ type testEntry struct { ...@@ -50,7 +50,7 @@ type testEntry struct {
itemv []kv itemv []kv
} }
// bmapping represents Get of Bucket or BTree. // bmapping represents LOBTree or a LOBucket wrapper.
type bmapping interface { type bmapping interface {
Get(context.Context, int64) (interface{}, bool, error) Get(context.Context, int64) (interface{}, bool, error)
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Copyright (c) 2001, 2002 Zope Foundation and Contributors. // Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved. // All Rights Reserved.
// //
// Copyright (C) 2018 Nexedi SA and Contributors. // Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This software is subject to the provisions of the Zope Public License, // This software is subject to the provisions of the Zope Public License,
...@@ -231,14 +231,14 @@ func (b *IOBucket) get(key int32) (interface{}, bool) { ...@@ -231,14 +231,14 @@ func (b *IOBucket) get(key int32) (interface{}, bool) {
type iobucketState IOBucket // hide state methods from public API type iobucketState IOBucket // hide state methods from public API
// DropState implements Stateful to discard bucket state. // DropState implements zodb.Stateful to discard bucket state.
func (b *iobucketState) DropState() { func (b *iobucketState) DropState() {
b.next = nil b.next = nil
b.keys = nil b.keys = nil
b.values = nil b.values = nil
} }
// PySetState implements PyStateful to set bucket data from pystate. // PySetState implements zodb.PyStateful to set bucket data from pystate.
func (b *iobucketState) PySetState(pystate interface{}) (err error) { func (b *iobucketState) PySetState(pystate interface{}) (err error) {
t, ok := pystate.(pickle.Tuple) t, ok := pystate.(pickle.Tuple)
if !ok { if !ok {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Copyright (c) 2001, 2002 Zope Foundation and Contributors. // Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved. // All Rights Reserved.
// //
// Copyright (C) 2018 Nexedi SA and Contributors. // Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This software is subject to the provisions of the Zope Public License, // This software is subject to the provisions of the Zope Public License,
...@@ -231,14 +231,14 @@ func (b *LOBucket) get(key int64) (interface{}, bool) { ...@@ -231,14 +231,14 @@ func (b *LOBucket) get(key int64) (interface{}, bool) {
type lobucketState LOBucket // hide state methods from public API type lobucketState LOBucket // hide state methods from public API
// DropState implements Stateful to discard bucket state. // DropState implements zodb.Stateful to discard bucket state.
func (b *lobucketState) DropState() { func (b *lobucketState) DropState() {
b.next = nil b.next = nil
b.keys = nil b.keys = nil
b.values = nil b.values = nil
} }
// PySetState implements PyStateful to set bucket data from pystate. // PySetState implements zodb.PyStateful to set bucket data from pystate.
func (b *lobucketState) PySetState(pystate interface{}) (err error) { func (b *lobucketState) PySetState(pystate interface{}) (err error) {
t, ok := pystate.(pickle.Tuple) t, ok := pystate.(pickle.Tuple)
if !ok { if !ok {
......
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