diff options
author | harti <harti@FreeBSD.org> | 2004-12-01 17:44:04 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-12-01 17:44:04 +0000 |
commit | 72af7896449ca4ce9ed7e076c22ef4b2d018b28f (patch) | |
tree | bfb9b4fa6024bbdd0e674e33e2cdba7ff273173f | |
parent | 44dde891d6bbef4f36952ff9c2024c691186daac (diff) | |
download | FreeBSD-src-72af7896449ca4ce9ed7e076c22ef4b2d018b28f.zip FreeBSD-src-72af7896449ca4ce9ed7e076c22ef4b2d018b28f.tar.gz |
Remove a double test for the same ptr != NULL and use the official
macro for this; reorder an if.
-rw-r--r-- | usr.bin/make/lst.lib/lstDestroy.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c index 5b9dc24..9ed1843 100644 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr.bin/make/lst.lib/lstDestroy.c @@ -68,23 +68,22 @@ void Lst_Destroy(Lst list, FreeProc *freeProc) { LstNode ln; - LstNode tln = NULL; + LstNode tln; - if (list == NULL || ! list) { + if (!Lst_Valid(list)) { /* - * Note the check for l == (Lst)0 to catch uninitialized static Lst's. + * Note the check to catch uninitialized static Lst's. * Gross, but useful. */ return; } - /* To ease scanning */ - if (list->lastPtr != NULL) - list->lastPtr->nextPtr = NULL; - else { + if (list->lastPtr == NULL) { free(list); return; } + /* To ease scanning */ + list->lastPtr->nextPtr = NULL; if (freeProc) { for (ln = list->firstPtr; ln != NULL; ln = tln) { |