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
In "list.c", slist_add() could be greatly simplified if we ignore the order - appending. This is how the code could look if we prepend to the list instead:
Yes, this would speed up the insertion of new items, but I guess not much. The current code uses a pointer to the last element of the list. The test for *list or *start to be a NULL pointer can not be dropped, so you save only one assignment. The current code is basically this:
Are you suffering from performance issues? I doubt this would be noticeable, not even with large numbers of additions, which we don't have in practice anyway?
In "list.c", slist_add() could be greatly simplified if we ignore the order - appending. This is how the code could look if we prepend to the list instead:
The text was updated successfully, but these errors were encountered: