Skip to content

Fix append!(l1, l2) for empty MutableLinkedList l2 #942

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leostenzel
Copy link

This PR addresses #941 and short circuits append(l1::MutableLinkedList, l2::MutableLinkedList) if l2 is empty.
Previously, l2.node would repeat infinitely.

There are also simple new tests to verify that appending from & to an empty MutableLinkedList gives the correct result.

And add tests for appending to and from an empty list.
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.

1 participant