diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-17 22:53:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 22:53:57 +0200 |
commit | 769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3 (patch) | |
tree | 524c7d9759fb9deae7b82581aa28fc8bc38265f6 /diff-lib.c | |
parent | Merge branch 'tg/rerere-doc-updates' (diff) | |
parent | show_dirstat: simplify same-content check (diff) | |
download | git-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.tar.xz git-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.zip |
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 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c index 70cddbf436..30bf9a2399 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -342,7 +342,7 @@ static int show_modified(struct rev_info *revs, } if (revs->combine_merges && !cached && - (oidcmp(oid, &old_entry->oid) || oidcmp(&old_entry->oid, &new_entry->oid))) { + (!oideq(oid, &old_entry->oid) || !oideq(&old_entry->oid, &new_entry->oid))) { struct combine_diff_path *p; int pathlen = ce_namelen(new_entry); @@ -366,7 +366,7 @@ static int show_modified(struct rev_info *revs, } oldmode = old_entry->ce_mode; - if (mode == oldmode && !oidcmp(oid, &old_entry->oid) && !dirty_submodule && + if (mode == oldmode && oideq(oid, &old_entry->oid) && !dirty_submodule && !revs->diffopt.flags.find_copies_harder) return 0; |