summaryrefslogtreecommitdiff
path: root/xdiff-interface.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-04-12 17:15:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-11 03:47:31 (GMT)
commit5b0672a26e51387bc18adad89eaa3ebb131b2e33 (patch)
tree2e437968309596dbdb7cdcfbc1bda73754b88cf2 /xdiff-interface.c
parent5d35a9531cc9af717383bc11c2dfa4edc020ac56 (diff)
downloadgit-5b0672a26e51387bc18adad89eaa3ebb131b2e33.zip
git-5b0672a26e51387bc18adad89eaa3ebb131b2e33.tar.gz
git-5b0672a26e51387bc18adad89eaa3ebb131b2e33.tar.bz2
pickaxe -S: slightly optimize contains()
When the "log -S<pat>" switch counts occurrences of <pat> on the pre-image and post-image of a change. As soon as we know we had e.g. 1 before and 2 now we can stop, we don't need to keep counting past 2. With this change a diff between A and B may have different performance characteristics than between B and A. That's OK in this case, since we'll emit the same output, and the effect is to make one of them better. I'm picking a check of "one" first on the assumption that it's a more common case to have files grow over time than not. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff-interface.c')
0 files changed, 0 insertions, 0 deletions