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 Issue 13171 - std.algorithm.until(range, sentinel, OpenRight.no) doe... #2358

Merged
merged 2 commits into from Jul 23, 2014

Conversation

NilsBossung
Copy link
Contributor

...sn't propagate popping of sentinel to range

https://issues.dlang.org/show_bug.cgi?id=13171

…doesn't propagate popping of sentinel to range
@DmitryOlshansky
Copy link
Member

LGTM

@quickfur
Copy link
Member

LGTM. I'm not sure about using bit ops to manipulate booleans, but in this case the alternative is significantly more verbose so I'll leave it at that.

@schuetzm
Copy link
Contributor

It could use ||= instead of |=, however.

@quickfur
Copy link
Member

There's no such operator as ||=. (Perhaps there should be? :P Good luck convincing Walter, though!)

@NilsBossung
Copy link
Contributor Author

On Monday 21 July 2014 12:04:13 H. S. Teoh wrote:

There's no such operator as ||=. (Perhaps there should be? :P Good luck
convincing Walter, though!)

I did type ||= at first.

I see one potential issue with |=: it's eager. The right side is always
evaluated, even when the left side is true already. I don't think that's a
problem here.

But if anyone would like to see _done = _done || _input.empty or some other
variant, say so and your wish shall be granted.

@schuetzm
Copy link
Contributor

@quickfur Wow, I was really convinced it exists. Should have checked first...
@NilsBossung Right, it will probably compile down to exactly the same machine code, no matter what you use.

@mihails-strasuns
Copy link

But if anyone would like to see _done = _done || _input.empty or some other
variant, say so and your wish shall be granted.

Please do. It is not that longer but will prevent inevitable "why bitops?" question from readers.

@NilsBossung
Copy link
Contributor Author

done

@mihails-strasuns
Copy link

thanks!

@mihails-strasuns
Copy link

Auto-merge toggled on

mihails-strasuns pushed a commit that referenced this pull request Jul 23, 2014
fix Issue 13171 - std.algorithm.until(range, sentinel, OpenRight.no) doe...
@mihails-strasuns mihails-strasuns merged commit 19b25be into dlang:master Jul 23, 2014
@NilsBossung NilsBossung deleted the 13171 branch July 23, 2014 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants