-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Iterator support seek ? #66
Comments
@zhengxiaochuan-3 sure, let's keep this issue open and see if more people vote for it. |
Any plan for this feature? |
@asdine looks like it's on the road map given the number of up votes |
Related to #95 |
#189 brings in the two new functions that can help achieve the above, i.e. NextTo() and PrevTo() Given the above comment on requested functionality, this can now be achieved with: // Seek key-value pair whose value starts with "1234"
seek := func(key interface{}, value interface{}) bool {
return strings.HasSuffix(value.(string), "1234")
}
for found := it.NextTo(seek); found; found = it.Next() {
key, value := it.Key(), it.Value()
...
} For a working example refer to: https://github.com/emirpasic/gods/blob/master/examples/iteratorwithkey/iteratorwithkey.go#L71-L80 Please let me know if the above is not what was requested so I can reopen this issue. |
Any follow up plan to add "seek" function for treemap ?
like:
The text was updated successfully, but these errors were encountered: