aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/bucket.go b/bucket.go
index e66d41c..9984fe8 100644
--- a/bucket.go
+++ b/bucket.go
@@ -39,10 +39,6 @@ var (
// on an existing non-bucket key or when trying to create or delete a
// non-bucket key on an existing bucket key.
ErrIncompatibleValue = errors.New("incompatible value")
-
- // ErrSequenceOverflow is returned when the next sequence number will be
- // larger than the maximum integer size.
- ErrSequenceOverflow = errors.New("sequence overflow")
)
const (
@@ -336,23 +332,16 @@ func (b *Bucket) Delete(key []byte) error {
}
// NextSequence returns an autoincrementing integer for the bucket.
-func (b *Bucket) NextSequence() (int, error) {
+func (b *Bucket) NextSequence() (uint64, error) {
if b.tx.db == nil {
return 0, ErrTxClosed
} else if !b.Writable() {
return 0, ErrTxNotWritable
}
- // Make sure next sequence number will not be larger than the maximum
- // integer size of the system.
- if b.bucket.sequence == uint64(maxInt) {
- return 0, ErrSequenceOverflow
- }
-
// Increment and return the sequence.
b.bucket.sequence++
-
- return int(b.bucket.sequence), nil
+ return b.bucket.sequence, nil
}
// ForEach executes a function for each key/value pair in a bucket.