diff options
Diffstat (limited to 'src/dedo.go')
-rw-r--r-- | src/dedo.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/dedo.go b/src/dedo.go index 7185a98..2bb805e 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -91,13 +91,6 @@ type DatabaseI interface{ Path() string } -type snapshotT struct{ - db *DB - meta *meta - root roBucketT - pages map[pgid]*page -} - /// transactionT represents a read-only or read/write transaction on the /// database. Read-only transactions can be used for retrieving values for keys /// and creating cursors. Read/write transactions can create and remove buckets @@ -127,15 +120,6 @@ type bucket struct { sequence uint64 /// monotonically incrementing, used by NextSequence() } -type roBucketT struct{ - ref *bucket - snapshot *snapshotT /// the associated snapshot - buckets map[string]*roBucketT /// subbucket cache - page *page /// inline page reference - rootNode *node /// materialized node for the root page - nodes map[pgid]*node /// node cache -} - /// Bucket represents a distinct collection of key/value pairs inside the /// database. Keys aren't unique across different buckets. type Bucket struct { @@ -598,11 +582,6 @@ func newBucket(tx *transactionT) Bucket { return b } -/// newBucket() returns a new bucket associated with a transaction. -func newSnapshotBucket(snapshot *snapshotT) roBucketT { - return roBucketT{snapshot: snapshot} -} - /// Bucket.Cursor() creates a cursor associated with the bucket. The cursor is /// only valid as long as the transaction is open. Do not use a cursor after /// the transaction is closed. @@ -3479,20 +3458,6 @@ func mergepgids(dst, a, b pgids) { _ = append(merged, follow...) } -func (snapshot *snapshotT) init(db *DB) { - snapshot.db = db - snapshot.pages = nil - - // Copy the meta page since it can be changed by the writer. - snapshot.meta = &meta{} - db.meta().copy(snapshot.meta) - - // Copy over the root bucket. - snapshot.root = newSnapshotBucket(snapshot) - snapshot.root.ref = &bucket{} - *snapshot.root.ref = snapshot.meta.root -} - /// transactionT.init() initializes the transaction. func (tx *transactionT) init(db *DB) { tx.db = db |