You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
consolidate_files sorts a linked list of files by name. It then walks the list and if the same name occurs multiple times it removes one of the duplicate names (it favors undeleted files over deleted ones, and renamed files over ones which have not been renamed). At the end it returns a pointer to the last file unless something went wrong, in which case it may return NULL.
As this is a doubly linked list, it is not a total disaster that it returns essentially the end of the list, but it would make more sense to return the start of the list. A typical use of this function is
consolidate_files sorts a linked list of files by name. It then walks the list and if the same name occurs multiple times it removes one of the duplicate names (it favors undeleted files over deleted ones, and renamed files over ones which have not been renamed). At the end it returns a pointer to the last file unless something went wrong, in which case it may return NULL.
As this is a doubly linked list, it is not a total disaster that it returns essentially the end of the list, but it would make more sense to return the start of the list. A typical use of this function is
The text was updated successfully, but these errors were encountered: