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

Int#divisible_by? doesn't care about the value being floored. #8045

Merged

Conversation

yxhuvud
Copy link
Contributor

@yxhuvud yxhuvud commented Aug 5, 2019

The if statement in % might be optimized away by LLVM, but why
force an optimization if the code isn't harder to understand when doing the optimized thing?

Potentially the if statement in % might be optimized away, but why
force LLVM to optimize something when it isn't necessary?
@straight-shoota straight-shoota merged commit 285d16f into crystal-lang:master Aug 8, 2019
@straight-shoota straight-shoota added this to the 0.31.0 milestone Aug 8, 2019
@straight-shoota
Copy link
Member

Thank you @yxhuvud :)

@yxhuvud yxhuvud deleted the divisible_can_use_remainder branch August 8, 2019 15:14
dnamsons pushed a commit to dnamsons/crystal that referenced this pull request Jan 10, 2020
…l-lang#8045)

Potentially the if statement in % might be optimized away, but why
force LLVM to optimize something when it isn't necessary?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants