fix Issue 7944 - std.range.iota.popFront() cycles when the range is empty #545

Merged
merged 2 commits into from Apr 23, 2012

Conversation

Projects
None yet
3 participants
@brad-anderson
Member

brad-anderson commented Apr 20, 2012

Added !empty assertions to front, popFront, back, and popBack to the integer iota like some other ranges do to catch popping an empty range. Also added the !empty assert to floating point iota front() which was the only one of those four that was missing.

http://d.puremagic.com/issues/show_bug.cgi?id=7944

fix Issue 7944 - std.range.iota.popFront() cycles when the range is e…
…mpty

Added !empty assertions to front, popFront, back, and popBack to the integer
iota like some other ranges do. Also added the one that was missing to the
floating point iota.
@schveiguy

This comment has been minimized.

Show comment
Hide comment
@schveiguy

schveiguy Apr 20, 2012

Member

Should we add asserts in opIndex?

Member

schveiguy commented Apr 20, 2012

Should we add asserts in opIndex?

@brad-anderson

This comment has been minimized.

Show comment
Hide comment
@brad-anderson

brad-anderson Apr 20, 2012

Member

Makes sense. I'll take a look.

Member

brad-anderson commented Apr 20, 2012

Makes sense. I'll take a look.

dsimcha added a commit that referenced this pull request Apr 23, 2012

Merge pull request #545 from eco/iota-pop-empty
fix Issue 7944 - std.range.iota.popFront() cycles when the range is empty

@dsimcha dsimcha merged commit 9233d3d into dlang:master Apr 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment