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

Fix #6262 #6266

Merged
merged 2 commits into from
Mar 27, 2014
Merged

Fix #6262 #6266

merged 2 commits into from
Mar 27, 2014

Conversation

simonster
Copy link
Member

Use an Int for the accumulation variable when iterating over integer types smaller than Int, and the type of the range when iterating over types larger than Int

Use an Int for the accumulation variable when iterating over integer
types smaller than Int, and the type of the range when iterating over
types larger than Int
@simonster simonster mentioned this pull request Mar 25, 2014
ifelse(stop < start, 0,
checked_add(checked_sub(convert(Int,stop),convert(Int,start)),1)),
0) # hack to elide negative length check
eval(:(typealias SmallInteger Union(Int8,Int16,Int32,Uint8,Uint16)))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the eval is necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are correct. I didn't internalize that the body of an if statement is still top-level scope.

@simonster
Copy link
Member Author

Should I merge this, or is the rangepocalypse nigh?

@JeffBezanson
Copy link
Member

Not sure. I guess this is safe enough that you should just merge it.

simonster added a commit that referenced this pull request Mar 27, 2014
@simonster simonster merged commit cc307ea into master Mar 27, 2014
@simonster simonster deleted the sjk/ranges branch March 27, 2014 15:48
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