tree-wide: apply equals-null.cocci

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2022-05-02 09:50:37 -07:00
parent 7a618493fa
commit afe8a9070b
63 changed files with 141 additions and 141 deletions

View File

@ -101,7 +101,7 @@ static inline struct llist_item *llist_insert(struct llist *list,
oidread(&new_item->oid, oid);
new_item->next = NULL;
if (after != NULL) {
if (after) {
new_item->next = after->next;
after->next = new_item;
if (after == list->back)
@ -157,7 +157,7 @@ redo_from_start:
if (cmp > 0) /* not in list, since sorted */
return prev;
if (!cmp) { /* found */
if (prev == NULL) {
if (!prev) {
if (hint != NULL && hint != list->front) {
/* we don't know the previous element */
hint = NULL;
@ -219,7 +219,7 @@ static struct pack_list * pack_list_difference(const struct pack_list *A,
struct pack_list *ret;
const struct pack_list *pl;
if (A == NULL)
if (!A)
return NULL;
pl = B;
@ -317,7 +317,7 @@ static size_t get_pack_redundancy(struct pack_list *pl)
struct pack_list *subset;
size_t ret = 0;
if (pl == NULL)
if (!pl)
return 0;
while ((subset = pl->next)) {
@ -611,7 +611,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix)
while (*(argv + i) != NULL)
add_pack_file(*(argv + i++));
if (local_packs == NULL)
if (!local_packs)
die("Zero packs found!");
load_all_objects();