commit 7c94ab42ffb47df7759085b11fcbc04cbe8e453f from: Omar Polo date: Mon Jan 10 19:16:27 2022 UTC simplify TAILQ_INSERT dance when a tailq is proprerly initialized, there's no need to check if it's empty and insert in head position. commit - 1e84c7b793afb2f25b7515283340a1f730290c3c commit + 7c94ab42ffb47df7759085b11fcbc04cbe8e453f blob - 373b881200da8e0c7a0c4e5f05ccf6d98baa56db blob + f7bc9a69ce83f416eb19cbf84d3cf0796392fd6f --- ninepscript/script.c +++ ninepscript/script.c @@ -1290,10 +1290,7 @@ test_done(int shouldfail, char *name) test->name = name; test->body = finalize(&blocks, NULL); - if (TAILQ_EMPTY(&tests)) - TAILQ_INSERT_HEAD(&tests, test, entry); - else - TAILQ_INSERT_TAIL(&tests, test, entry); + TAILQ_INSERT_TAIL(&tests, test, entry); ntests++; }