mirror of
https://github.com/git/git.git
synced 2026-01-27 10:58:50 +00:00
The fscache_clear() function used to be O(n^2). But we can easily make it O(n) instead. Update fscache_clear to be O(n) instead of O(n^2) by using inter_next instead of starting from the begining each time with iter_first. While at it, also disallow rehashing while removing the entries. This speeds up a simple `git commit -m foo` when fscache is enabled (because fscache_clear() is called implicitly by preload_index()). Signed-off-by: Ben Peart <Ben.Peart@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>