diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2010-09-26 18:26:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-30 11:43:07 -0700 |
commit | c099789bb01b810e40f9cfaa5c842ed568110fc8 (patch) | |
tree | 1a4b9a59bd1363fc47636b1b6a49a838f9377bad /t/t3504-cherry-pick-rerere.sh | |
parent | do not search functions for patch ID (diff) | |
download | tgif-c099789bb01b810e40f9cfaa5c842ed568110fc8.tar.xz |
diff: avoid repeated scanning while looking for funcname
For each hunk, xdl_find_func searches the preimage for a function name
until the beginning of the file. If the file does not contain any
function names, this search has complexity O(n^2) in the number of
hunks n.
Instead, inline xdl_find_func() and keep track of up to which line we
have scanned already and the contents of the last funcname line that
we have found.
Noticed and a different approach proposed by Clemens Buchacher.
This alternative solution was done by René Scharfe.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3504-cherry-pick-rerere.sh')
0 files changed, 0 insertions, 0 deletions