]> git.ipfire.org Git - thirdparty/git.git/commit
merge-recursive: optimize time complexity for process_renames
authorMeet Soni <meetsoni3017@gmail.com>
Fri, 14 Feb 2025 04:41:29 +0000 (10:11 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2025 05:33:00 +0000 (21:33 -0800)
commitb07dd9078b8ba5f3b7f5c88f84f7ee9c34fa65e1
tree67c9dbfe2caf17a70870bebd1ee2cc49085635dc
parente2067b49ecaef9b7f51a17ce251f9207f72ef52d
merge-recursive: optimize time complexity for process_renames

Avoid O(n^2) complexity in `process_renames()` when building a sorted
`string_list` by constructing it unsorted and sorting it afterward,
reducing the complexity to O(n log n).

Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c