diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-01 09:21:11 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-01 09:21:11 -0700 |
commit | 7214e089c0f78fce8fb1e00f09f7d2b54c88bdbe (patch) | |
tree | 75850081fdb236f37c82d6e8fcd4cde5b81354d8 /rwtransaction.go | |
parent | Merge branch 'master' of https://github.com/boltdb/bolt (diff) | |
parent | Allow reads of unflushed nodes. (diff) | |
download | dedo-7214e089c0f78fce8fb1e00f09f7d2b54c88bdbe.tar.gz dedo-7214e089c0f78fce8fb1e00f09f7d2b54c88bdbe.tar.xz |
Merge pull request #57 from benbjohnson/node-aware-cursors
Allow reads of unflushed nodes.
Diffstat (limited to 'rwtransaction.go')
-rw-r--r-- | rwtransaction.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rwtransaction.go b/rwtransaction.go index ddd4b96..f47597f 100644 --- a/rwtransaction.go +++ b/rwtransaction.go @@ -11,7 +11,6 @@ import ( // functions provided by Transaction. type RWTransaction struct { Transaction - nodes map[pgid]*node pending []*node } @@ -20,6 +19,7 @@ func (t *RWTransaction) init(db *DB) { t.Transaction.init(db) t.Transaction.rwtransaction = t t.pages = make(map[pgid]*page) + t.nodes = make(map[pgid]*node) // Increment the transaction id. t.meta.txnid += txnid(1) @@ -266,7 +266,7 @@ func (t *RWTransaction) writeMeta() error { // node creates a node from a page and associates it with a given parent. func (t *RWTransaction) node(pgid pgid, parent *node) *node { // Retrieve node if it has already been fetched. - if n := t.nodes[pgid]; n != nil { + if n := t.Transaction.node(pgid); n != nil { return n } |