-
Notifications
You must be signed in to change notification settings - Fork 36
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
Optimized for loop & overflow #2130
Comments
Fixed for iteration over measures. Spans next. |
Optimizing span iteration turns out to be much harder. Specifically getting a C-style |
@tombentley Well, yes, but the difference is you don't need to box the |
…e consistent with the unoptimized version even in edge cases like overflow.
Still a couple of edge cases to fix here, but I need to work on something else today. |
@tombentley good ;) |
I'm guessing related to this work, I'm getting: print(3 in 0:3); //true
print((0:3).contains(3)); //false |
…use length > 0 && start < x && x < start.neighbour(length) because that's not what Measure actually does so it doesn't behave correctly wrt overflow.
…eed it for optimized measure loops on the JVM
…r because in the case where ++ throws it complicates optimization to a C-style for loop.
… cases by == 1 to avoid incorrect results in situations of overflow.
I think this is fixed with the exception of those Span affected by ceylon/ceylon.language#717, where the unoptimized loop never executes because the Span constructor throws, but the optimized loop is executing at least once. I suppose I can add a check for those cases, but I'll wait to see if people care about fixing ceylon/ceylon.language#717 first. |
Add immediately after I made that comment I find something else which is broken. |
I have at this point concluded we're flogging a dead horse in trying to squeeze the span iteration optimization into a |
…next in the same invocation as we return it. Previously the current invocation computed the next invocations result. That produced incorrect results when that computation overflowed (e.g. iterating up to the last Character).
…definitely entered, so we don't need the flow appeaser. But we do need to omit the post-body statements if we know the body returns.
Fixed, finally. |
Neither of these produce output:
This relates to ceylon/ceylon.language/issues/656.
The text was updated successfully, but these errors were encountered: