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 list reversal #1457

Merged
merged 1 commit into from
Aug 28, 2023
Merged

Fix list reversal #1457

merged 1 commit into from
Aug 28, 2023

Conversation

plajjan
Copy link
Contributor

@plajjan plajjan commented Aug 28, 2023

lst->data is NULL for a 0 length list, which we can't copy, so got to check!

And for reversed() we have to actually return the reversed copy of the list, not the original! ;)

Add some tests for it...

Fixes #1455

@plajjan plajjan enabled auto-merge August 28, 2023 19:31
lst->data is NULL for a 0 length list, which we can't copy, so got to
check!

And for reversed() we have to actually return the reversed copy of the
list, not the original! ;)

Add some tests for it...
@plajjan plajjan merged commit e7a296f into main Aug 28, 2023
24 checks passed
@plajjan plajjan deleted the fix-list-reverse branch August 28, 2023 19:58
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.

List.__reversed__ doesn't reverse and crashes on empty lists in dev-mode
1 participant