From 8438c6ebc3a6ccd05e33f7bc1e9648645f3c0831 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 20 Feb 2014 10:55:04 -0800 Subject: Cursor.Get is now Cursor.Seek, and returns the first possible key. This makes range and prefix queries possible. Closes: #44 --- rwtransaction.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rwtransaction.go') diff --git a/rwtransaction.go b/rwtransaction.go index 84e6425..e22c766 100644 --- a/rwtransaction.go +++ b/rwtransaction.go @@ -20,7 +20,7 @@ func (t *RWTransaction) init(db *DB) { t.Transaction.init(db) t.pages = make(map[pgid]*page) - // Increment the transaction id. + // Increment the transaction id. t.meta.txnid += txnid(1) } @@ -114,7 +114,7 @@ func (t *RWTransaction) Put(name string, key []byte, value []byte) error { // Move cursor to correct position. c := b.cursor() - c.Get(key) + c.Seek(key) // Insert the key/value. c.node(t).put(key, key, value, 0) @@ -133,7 +133,7 @@ func (t *RWTransaction) Delete(name string, key []byte) error { // Move cursor to correct position. c := b.cursor() - c.Get(key) + c.Seek(key) // Delete the node if we have a matching key. c.node(t).del(key) -- cgit v1.2.3