Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

consolidate_files returns unhelpful values #75

Open
icarus-sparry opened this issue Sep 20, 2017 · 0 comments
Open

consolidate_files returns unhelpful values #75

icarus-sparry opened this issue Sep 20, 2017 · 0 comments

Comments

@icarus-sparry
Copy link

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

server_manifest->files = consolidate_files(server_manifest->files);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant