commit 2fa08c64136f5b53fb382e8369815ef94ba74ce0 from: Neels Hofmeyr date: Thu Oct 22 01:17:21 2020 UTC optimize diff_atom_same(): if hashes differ, return false commit - 845f35754a8e7935c62f11f48d5dedd536a0615c commit + 2fa08c64136f5b53fb382e8369815ef94ba74ce0 blob - 23c9144b4f1d0b6f1c12b6cbfb0ee1af139d4671 blob + 7c1b831a3433f7d51209934dad51ee7c36826bae --- lib/diff_main.c +++ lib/diff_main.c @@ -198,7 +198,12 @@ diff_atom_same(bool *same, const struct diff_atom *right) { int cmp; - int r = diff_atom_cmp(&cmp, left, right); + int r; + if (left->hash != right->hash) { + *same = false; + return 0; + } + r = diff_atom_cmp(&cmp, left, right); if (r) { *same = true; return r;