Clarify duplicate insertion logic in parser_alias.c:process_entries

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
Ryan Lee 2024-11-13 14:34:55 -08:00
parent f24fc4841f
commit 9689e3a39f

View file

@ -142,8 +142,10 @@ static void process_entries(const void *nodep, VISIT value, int level unused)
} }
if (dup) { if (dup) {
dup->alias_ignore = true; dup->alias_ignore = true;
/* adds to the front of the list, list iteratition /* The original entry->next is in dup->next, so we don't lose
* will skip it * any of the original elements of the linked list. Also, by
* setting dup->alias_ignore, we trigger the check at the start
* of the loop, skipping the new entry we just inserted.
*/ */
entry->next = dup; entry->next = dup;