dupe: Optimize memory handling in dupe_files_add_queue_cb()
authorFrej Drejhammar <frej.drejhammar@gmail.com>
Sat, 13 Feb 2021 15:55:05 +0000 (16:55 +0100)
committerFrej Drejhammar <frej.drejhammar@gmail.com>
Sat, 27 Mar 2021 11:49:19 +0000 (12:49 +0100)
commit513bc7148be74632d9c410ffbfaf8c3e21a82aef
tree2167c82c038e9d72fbb1e9f5a5c9e06e9e31cd9e
parent5eab9b5f7815fa579b7c53dd8c1c17e9651ff18b
dupe: Optimize memory handling in dupe_files_add_queue_cb()

Do not traverse the lists returned by filelist_filter() while
allocating new list links with g_list_prepend(). Instead prepend the
lists to dw->add_files_queue using g_list_concat(). Although
g_list_concat() has to traverse the lists containing the new items to
find their ends, it avoids redundant memory allocation and
deallocation.
src/dupe.c