Skip to content
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

Merged
merged 5 commits into from
Jun 16, 2024

Conversation

Paalon
Copy link
Contributor

@Paalon Paalon commented Jun 11, 2024

This PR includes the following improvements:

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.05%. Comparing base (844ad27) to head (f5020fc).
Report is 5 commits behind head on master.

Current head f5020fc differs from pull request most recent head c828316

Please upload reports for the commit c828316 to get more accurate results.

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.
📢 Have feedback on the report? Share it here.

@Paalon Paalon changed the title Small refactoring of src/buffered_input.jl Refactoring of src/buffered_input.jl Jun 11, 2024
@GunnarFarneback
Copy link
Contributor

  • Don't calculate the same value twice.

This is often a good idea but I think it's questionable whether replacing i + 1 with i1 really makes the code clearer. (And performance changes are at best marginal.)

  • Remove end of function returns.

This is a kind of opinionated style change that I wouldn't make to an existing code base.

Everything else I fully agree with.

@kescobo
Copy link
Collaborator

kescobo commented Jun 12, 2024

This is a kind of opinionated style change that I wouldn't make to an existing code base.

And furthermore, I actually prefer explicit returns. Otherwise, I agree, and thanks @GunnarFarneback for taking a look at these

@Paalon
Copy link
Contributor Author

Paalon commented Jun 14, 2024

I removed these returns because this project's source code tends to not use return at the end of function, and also it's my preference in Julia. However if community wants to preserve it, I'll revert these returns.

@kescobo
Copy link
Collaborator

kescobo commented Jun 14, 2024

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.

@GunnarFarneback
Copy link
Contributor

tends to not use return at the end of function

Fair enough.

@kescobo kescobo merged commit 5bb060a into JuliaData:master Jun 16, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants