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

refactor: remove single iteration loop #176

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

nickajacks1
Copy link
Contributor

Simplify code by taking the first element instead of performing a single-iteration loop.

Disclaimer: I wasn't actually 100% sure if there was some magic going on that I didn't realize.
Discovered using https://github.com/golangci/golangci-lint

Simplify code by taking the first element instead of
performing a single-iteration loop.
@daveshanley
Copy link
Member

daveshanley commented Sep 23, 2023

This is by design, removing it will result in incorrect results. Thats why there is a comment on the break. I cannot accept this unfortunately, it will break the library.

edit

I didn't read closely enough, I looked at the code and it's not going to break.

@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (3c9415b) 99.80% compared to head (c39c494) 99.80%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
- Coverage   99.80%   99.80%   -0.01%     
==========================================
  Files         148      148              
  Lines       10673    10669       -4     
==========================================
- Hits        10652    10648       -4     
  Misses         21       21              
Flag Coverage Δ
unittests 99.80% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
renderer/schema_renderer.go 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this logic. I don't know what I was thinking when I wrote it, I must have been distracted.

@daveshanley daveshanley mentioned this pull request Oct 8, 2023
@daveshanley daveshanley merged commit 4847c4b into pb33f:main Oct 8, 2023
3 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.

2 participants