summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2010-09-26 18:26:56 +0200
committerJunio C Hamano <gitster@pobox.com>2010-09-30 11:43:07 -0700
commitc099789bb01b810e40f9cfaa5c842ed568110fc8 (patch)
tree1a4b9a59bd1363fc47636b1b6a49a838f9377bad /diff.c
parentad14b450c0c70bfcf90de0aa19ffa5e44e402b69 (diff)
downloadgit-c099789bb01b810e40f9cfaa5c842ed568110fc8.tar.gz
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 'diff.c')
0 files changed, 0 insertions, 0 deletions