Fix quadratic performance in rewrite_one.
commitfce87ae53883d22a9912abb2d11a926de747006e
authorAlexander N. Gavrilov <angavrilov@gmail.com>
Sat, 12 Jul 2008 18:00:57 +0000 (12 22:00 +0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 Jul 2008 20:46:56 +0000 (13 13:46 -0700)
tree4b86b3ed068814d0b2cc1d4c85473b20e8ee35ec
parente09c4e753c337d914f4eb7a05cb5e8bbfc362489
Fix quadratic performance in rewrite_one.

Parent commits are usually older than their children. Thus,
on each iteration of the loop in rewrite_one, add_parents_to_list
traverses all commits previously processed by the loop.
It performs very poorly in case of very long rewrite chains.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c