Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

If else simplification #22

Merged
merged 3 commits into from
Jan 17, 2023

Conversation

jkrumbiegel
Copy link
Contributor

This is just a suggestion, feel free to close if you think the original is more readable.
I saw there were very long if else statements, sometimes only one line is different.
You can express that via the @nif macro quite well, so I shortened the code with it.

@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #22 (fb2aec1) into main (fe71c4f) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
- Coverage   99.91%   99.88%   -0.03%     
==========================================
  Files           8        8              
  Lines        1176      903     -273     
==========================================
- Hits         1175      902     -273     
  Misses          1        1              
Impacted Files Coverage Δ
src/columns.jl 100.00% <100.00%> (ø)
src/table.jl 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@junyuan-chen
Copy link
Owner

@jkrumbiegel Thank you for making this suggestion. This looks good to me! I wasn't aware of such a macro that could save my manual repetition.

@jkrumbiegel
Copy link
Contributor Author

All the macros starting with n in Base.Cartesian are pretty good if you're in such a situation :)

@junyuan-chen junyuan-chen merged commit f13e4ac into junyuan-chen:main Jan 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants