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 12996 - SList: linearRemove cannot remove root node #2271

Merged
merged 1 commit into from Jun 28, 2014
Merged

Fix Issue 12996 - SList: linearRemove cannot remove root node #2271

merged 1 commit into from Jun 28, 2014

Conversation

sigod
Copy link
Contributor

@sigod sigod commented Jun 26, 2014

auto s = SList!int(1, 2, 3, 4, 5);
auto r = s[];
auto r1 = s.linearRemove(r); // exception
auto r1 = s.linearRemove(r.take(5)); // this works

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

@monarchdodra
Copy link
Collaborator

Ideally, this kind of special casing could be avoided if SList carried an empty root node, rather than simply having a root "pointer". But, this is as good a fix as any.

Approved for auto-testers.

@monarchdodra
Copy link
Collaborator

Auto-merge toggled on

monarchdodra added a commit that referenced this pull request Jun 28, 2014
Fix Issue 12996 - SList: linearRemove cannot remove root node
@monarchdodra monarchdodra merged commit 433fdd4 into dlang:master Jun 28, 2014
@sigod sigod deleted the issue_12996 branch June 28, 2014 20:02
@sigod
Copy link
Contributor Author

sigod commented Jun 28, 2014

Ideally, this kind of special casing could be avoided if SList carried an empty root node, rather than simply having a root "pointer".

I'll look at it when 2.066 will be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants