-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use strings.Cut() instead of string.SplitN() #4049
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4049 +/- ##
=====================================
Coverage 83.3% 83.3%
=====================================
Files 181 181
Lines 13934 13925 -9
=====================================
- Hits 11614 11610 -4
+ Misses 2099 2094 -5
Partials 221 221
|
f323f59
to
3e80b34
Compare
Please include some sort of performance benchmarking with this PR to motivate these changes. |
@MrAlias Added benchmark to the description. |
exporters/jaeger/internal/third_party/thrift/lib/go/thrift/multiplexed_protocol.go
Outdated
Show resolved
Hide resolved
exporters/jaeger/internal/third_party/thrift/lib/go/thrift/multiplexed_protocol.go
Outdated
Show resolved
Hide resolved
@pellared Thanks. I was not sure how to name those and hoped to get some suggestions during the review. |
👍 Just please add "regular commits" (do not rebase) in future as it makes reviewing diffs a lot easier 😉 |
strings.Cut() generates less garbage as it does not allocate the slice to hold parts.
Fixed the conflict. It's ready for merging. |
We still need another review from a person with a different employer. |
strings.Cut()
generates less garbage as it does not allocate the slice to hold parts.strings.Cut()
is more readable as it's easier to deal withbool
vsint
- less branching is usually required, fewer arguments to the function call, simpler semantics. See bytes, strings: add Cut golang/go#46336.