-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a uint indexer #26
Conversation
This PR introduces a uint indexer that works for any uint type: uint, uint8, uint16, uint32, uint64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
index.go
Outdated
} | ||
|
||
val := v.Uint() | ||
buf := make([]byte, 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You think it's worth exploiting a memory footprint advantage by having IsUintType()
return the required size and allocating just what's needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not worth the complexity...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was easy enough! Done!
linking #30 related to this PR |
full diff: hashicorp/go-memdb@cb9a474...v1.0.3 possibly relevant changes: - hashicorp/go-memdb#21 Added a new MultiIndexer for map[string]string fields - hashicorp/go-memdb#23 Adds support for fine-grained watches - hashicorp/go-memdb#25 Delays mutation notifications until after the whole transaction is applied - fixes hashicorp/go-memdb#24 Notify channels close early during a commit - hashicorp/go-memdb#26 Add a uint indexer - hashicorp/go-memdb#31 Fix buffer size when encoding uint fields - hashicorp/go-memdb#35 Add DeletePrefix method that allows faster deletes of objects in the id index - hashicorp/go-memdb#37 Add WatchCtx function - hashicorp/go-memdb#38 WatchCtx returns error - hashicorp/go-memdb#39 Add a FilterIterator that wraps a ResultIterator - hashicorp/go-memdb#42 use ErrNotFound for deleting missing item - hashicorp/go-memdb#50 fix: dereference pointers for String Fields - hashicorp/go-memdb#52 fix: allow nil string pointers - hashicorp/go-memdb#59 Add Int indexing - hashicorp/go-memdb#60 Add CompoundMultiIndexer - hashicorp/go-memdb#81 Add LowerBound to allow for index range scans Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: hashicorp/go-memdb@cb9a474...v1.0.3 possibly relevant changes: - hashicorp/go-memdb#21 Added a new MultiIndexer for map[string]string fields - hashicorp/go-memdb#23 Adds support for fine-grained watches - hashicorp/go-memdb#25 Delays mutation notifications until after the whole transaction is applied - fixes hashicorp/go-memdb#24 Notify channels close early during a commit - hashicorp/go-memdb#26 Add a uint indexer - hashicorp/go-memdb#31 Fix buffer size when encoding uint fields - hashicorp/go-memdb#35 Add DeletePrefix method that allows faster deletes of objects in the id index - hashicorp/go-memdb#37 Add WatchCtx function - hashicorp/go-memdb#38 WatchCtx returns error - hashicorp/go-memdb#39 Add a FilterIterator that wraps a ResultIterator - hashicorp/go-memdb#42 use ErrNotFound for deleting missing item - hashicorp/go-memdb#50 fix: dereference pointers for String Fields - hashicorp/go-memdb#52 fix: allow nil string pointers - hashicorp/go-memdb#59 Add Int indexing - hashicorp/go-memdb#60 Add CompoundMultiIndexer - hashicorp/go-memdb#61 Add LowerBound to allow for index range scans Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Using a fork of go-immutable-radix temporarily until PR #26 is accepted * Adding Snapshot method to Txn to create a read-only snapshot of the transaction * Removed temporary replacement; updated go-immutable-radix to v1.2.0
This PR introduces a uint indexer that works for any uint type: uint,
uint8, uint16, uint32, uint64.