-
Notifications
You must be signed in to change notification settings - Fork 46
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
Refactoring of src/buffered_input.jl
#156
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #156 +/- ##
==========================================
+ Coverage 86.59% 87.05% +0.46%
==========================================
Files 12 12
Lines 1626 1630 +4
==========================================
+ Hits 1408 1419 +11
+ Misses 218 211 -7 ☔ View full report in Codecov by Sentry. |
src/buffered_input.jl
src/buffered_input.jl
This is often a good idea but I think it's questionable whether replacing
This is a kind of opinionated style change that I wouldn't make to an existing code base. Everything else I fully agree with. |
And furthermore, I actually prefer explicit returns. Otherwise, I agree, and thanks @GunnarFarneback for taking a look at these |
I removed these |
A consistent code base is more important to me than my specific preference. If that's the style elsewhere in the code, I'm fine to remove them here. |
Fair enough. |
This PR includes the following improvements:
_
for a discarded value.Vector{Char}(undef, 0)
toChar[]
.return
s.string(x...)
toString(x)
forx::Vector{Char}
. It is approximately 9 times faster and less allocations. https://discourse.julialang.org/t/for-x-vector-char-which-should-i-use-string-x-or-join-x/115469