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

Fixed crash when removing the first node from a LinkedList with a cou… #106

Closed
wants to merge 1 commit into from

Conversation

malmazuke
Copy link

…nt of 1

This crash can be reproduced by creating a new LinkedList, adding a value, and then immediately removing it. The crash occurs because head.next is nil.

Additionally, I moved the index == 0 check before the initialization of current, as it doesn't need to use it.

I can change the ternary operator to an if-statement if you think it's more readable.

@waynewbishop
Copy link
Owner

Hi @malmazuke, thanks for sending along this PR. Have you also had a chance to check this issue / fix with the Swift-3.0 branch?

https://github.com/waynewbishop/SwiftStructures/tree/swift-3.0

@malmazuke
Copy link
Author

Hi @waynewbishop, not yet. I can't get the swift-3.0 branch compiling unfortunately. I'm using Xcode 8 beta 6.

@waynewbishop
Copy link
Owner

Hi @malmazuke, sounds good. I just updated the code project to support Xcode 8.0 beta 6. If you would like to resubmit your PR that would be great.

@malmazuke malmazuke closed this Dec 20, 2023
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.

None yet

2 participants