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

Expand Int#to_s optimization from 0..1 to 0..9 #5891

Closed
wants to merge 1 commit into from

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Mar 31, 2018

Why cover just these 2 cases if we can cover them all?

@RX14
Copy link
Contributor

RX14 commented Mar 31, 2018

...because you can't? 2 in binary is 01, not 2.

@RX14 RX14 closed this Mar 31, 2018
@Sija
Copy link
Contributor Author

Sija commented Mar 31, 2018

@RX14 ah, forgot about binary, 🤦

@Sija
Copy link
Contributor Author

Sija commented Mar 31, 2018

@RX14 hmm, are octal numbers not lexed and turned into decimals before they reach Int#to_s?

num = num * 8 + (char - '0')

@RX14
Copy link
Contributor

RX14 commented Mar 31, 2018

@Sija what? this has nothing to do with the compiler.

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.

None yet

2 participants