summaryrefslogtreecommitdiff
path: root/pack-bitmap.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-02 17:06:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-05-02 17:06:04 (GMT)
commit2b0a58d164b0642be3eeb476fecd28114445cdd5 (patch)
tree2759549fcdd5d3ce4c9776f67937b4b75c07070f /pack-bitmap.c
parentd516b2db0af2221bd6b13e7347abdcb5830b2829 (diff)
parentafe8a9070bc62db9cfde1e30147178c40d391d93 (diff)
downloadgit-2b0a58d164b0642be3eeb476fecd28114445cdd5.zip
git-2b0a58d164b0642be3eeb476fecd28114445cdd5.tar.gz
git-2b0a58d164b0642be3eeb476fecd28114445cdd5.tar.bz2
Merge branch 'ep/maint-equals-null-cocci' for maint-2.35
* ep/maint-equals-null-cocci: tree-wide: apply equals-null.cocci contrib/coccinnelle: add equals-null.cocci
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index f772d3c..1a99984 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -111,7 +111,7 @@ static struct ewah_bitmap *lookup_stored_bitmap(struct stored_bitmap *st)
struct ewah_bitmap *parent;
struct ewah_bitmap *composed;
- if (st->xor == NULL)
+ if (!st->xor)
return st->root;
composed = ewah_pool_new();
@@ -279,7 +279,7 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
if (xor_offset > 0) {
xor_bitmap = recent_bitmaps[(i - xor_offset) % MAX_XOR_OFFSET];
- if (xor_bitmap == NULL)
+ if (!xor_bitmap)
return error("Invalid XOR offset in bitmap pack index");
}
@@ -724,7 +724,7 @@ static int add_commit_to_bitmap(struct bitmap_index *bitmap_git,
if (!or_with)
return 0;
- if (*base == NULL)
+ if (!*base)
*base = ewah_to_bitmap(or_with);
else
bitmap_or_ewah(*base, or_with);
@@ -768,7 +768,7 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
* Best case scenario: We found bitmaps for all the roots,
* so the resulting `or` bitmap has the full reachability analysis
*/
- if (not_mapped == NULL)
+ if (!not_mapped)
return base;
roots = not_mapped;
@@ -802,7 +802,7 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
struct include_data incdata;
struct bitmap_show_data show_data;
- if (base == NULL)
+ if (!base)
base = bitmap_new();
incdata.bitmap_git = bitmap_git;
@@ -1298,7 +1298,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
reset_revision_walk();
revs->ignore_missing_links = 0;
- if (haves_bitmap == NULL)
+ if (!haves_bitmap)
BUG("failed to perform bitmap walk");
}
@@ -1696,7 +1696,7 @@ void test_bitmap_walk(struct rev_info *revs)
result = ewah_to_bitmap(bm);
}
- if (result == NULL)
+ if (!result)
die("Commit %s doesn't have an indexed bitmap", oid_to_hex(&root->oid));
revs->tag_objects = 1;