Skip to content

Add LL_REVERSE/DL_REVERSE/CDL_REVERSE macros to utlist - #278

Closed
xunicatt wants to merge 10 commits into
troydhanson:masterfrom
xunicatt:master
Closed

Add LL_REVERSE/DL_REVERSE/CDL_REVERSE macros to utlist#278
xunicatt wants to merge 10 commits into
troydhanson:masterfrom
xunicatt:master

Conversation

@xunicatt

@xunicatt xunicatt commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

This PR adds LL_REVERSE/LL_REVERSE2, DL_REVERSE/DL_REVERSE2 and CDL_REVERSE/CDL_REVERSE2 macros to
utlist.h, along with documentation, updates and tests.

Reversing a list is a common operation when building lists using LL_PREPEND
in a loop and reversing at the end instead of repeatedly using LL_APPEND.
This usage pattern was mentioned in #197 and #263.

@xunicatt
xunicatt marked this pull request as draft March 12, 2026 06:14
@xunicatt xunicatt changed the title Add LL_REVERSE/DL_REVERSE macros to utlist Add LL_REVERSE/DL_REVERSE/CDL_REVERSE macros to utlist Mar 12, 2026
@xunicatt

Copy link
Copy Markdown
Contributor Author

Sorry for the previous commit message formatting, the backticks were eaten by my shell while committing from terminal.

@xunicatt
xunicatt marked this pull request as ready for review March 12, 2026 07:15

@Quuxplusone Quuxplusone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance this looks very good!

I haven't checked it out and run the tests or really gone over the code, but in this brief online review I'm not seeing any red flags. Will take a closer look Real Soon Now.

Comment thread doc/utlist.txt
Comment thread src/utlist.h Outdated
Comment thread src/utlist.h Outdated
@xunicatt

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I've updated the PR and fixed the issues you mentioned. Let me know if anything else needs to be changed.

Comment thread src/utlist.h Outdated
Quuxplusone added a commit to Quuxplusone/uthash that referenced this pull request Mar 18, 2026
@Quuxplusone

Copy link
Copy Markdown
Collaborator

Merged as 6d85739 (with different test coverage) — thanks!

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.

2 participants