diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-17 13:53:57 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 13:53:57 -0700 |
commit | 769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3 (patch) | |
tree | 524c7d9759fb9deae7b82581aa28fc8bc38265f6 /log-tree.c | |
parent | Merge branch 'tg/rerere-doc-updates' (diff) | |
parent | show_dirstat: simplify same-content check (diff) | |
download | tgif-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.tar.xz |
Merge branch 'jk/cocci'
spatch transformation to replace boolean uses of !hashcmp() to
newly introduced oideq() is added, and applied, to regain
performance lost due to support of multiple hash algorithms.
* jk/cocci:
show_dirstat: simplify same-content check
read-cache: use oideq() in ce_compare functions
convert hashmap comparison functions to oideq()
convert "hashcmp() != 0" to "!hasheq()"
convert "oidcmp() != 0" to "!oideq()"
convert "hashcmp() == 0" to hasheq()
convert "oidcmp() == 0" to oideq()
introduce hasheq() and oideq()
coccinelle: use <...> for function exclusion
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/log-tree.c b/log-tree.c index e5b353ea2d..7a83e99250 100644 --- a/log-tree.c +++ b/log-tree.c @@ -474,7 +474,7 @@ static int which_parent(const struct object_id *oid, const struct commit *commit const struct commit_list *parent; for (nth = 0, parent = commit->parents; parent; parent = parent->next) { - if (!oidcmp(&parent->item->object.oid, oid)) + if (oideq(&parent->item->object.oid, oid)) return nth; nth++; } @@ -508,8 +508,8 @@ static int show_one_mergetag(struct commit *commit, if (parse_tag_buffer(the_repository, tag, extra->value, extra->len)) strbuf_addstr(&verify_message, "malformed mergetag\n"); else if (is_common_merge(commit) && - !oidcmp(&tag->tagged->oid, - &commit->parents->next->item->object.oid)) + oideq(&tag->tagged->oid, + &commit->parents->next->item->object.oid)) strbuf_addf(&verify_message, "merged tag '%s'\n", tag->tag); else if ((nth = which_parent(&tag->tagged->oid, commit)) < 0) |