-
Notifications
You must be signed in to change notification settings - Fork 57
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
UnsafeBufferOperations.forEachSegment implementation #383
Conversation
More concise replacement for 'iterate' function
This is a draft, please take a look. If you are good with the idea, I'll deprecate |
core/jvm/src/BuffersJvm.kt
Outdated
} | ||
curr = ctx.next(curr) ?: break | ||
currentOffset = 0 | ||
var firstSegmentHandled = false |
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.
This one is unfortunate, please take a closer look.
It also comes with a few more if
s this time, not sure it's a measurable effect though
@qwwdfsad Nicely done!
I'm all in with adding a new API, but I have some doubts about existing API's deprecation. |
…unction * Add a single sample for 'iterate' and 'BufferIterationContext' * Rewrite previous samples using 'forEachSegment' * Remove 'forEachSegment' overload with offset, 'iterate' is recommended for that
Co-authored-by: Filipp Zhinkin <filipp.zhinkin@jetbrains.com>
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. Thanks!
More concise replacement for 'iterate' function