From b872d4db1840309519f458ed62ddeef5fdda683a Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 1 Nov 2024 12:45:09 +0200 Subject: [PATCH] Fix a horrible performance regression caused by missing & One of the busiest functions in rpm was getting passed a new copy of a big unordered_map on each call during fingerprinting because "somebody" forgot a & in commit 08a6a5e848f007c2e8d83fc1df8712d1a43229f4. This isn't even noticeable in the test-suite or daily "update a few dozen packages" operation but when attempting to install/update a few thousand packages dragged this little buglet to the light... Why oh why C++ do you behave in such an idiotic manner in the face of stupid mistakes. Raw pointers at least give you a compiler error. --- lib/fprint.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fprint.cc b/lib/fprint.cc index 364a52ea87..436d607f77 100644 --- a/lib/fprint.cc +++ b/lib/fprint.cc @@ -311,7 +311,7 @@ fingerPrint * fpLookupList(fingerPrintCache cache, rpmstrPool pool, } /* Check file for to be installed symlinks in their path and correct their fp */ -static void fpLookupSubdir(rpmFpHash symlinks, fingerPrintCache fpc, fingerPrint *fp) +static void fpLookupSubdir(rpmFpHash & symlinks, fingerPrintCache fpc, fingerPrint *fp) { struct fingerPrint current_fp; const char *currentsubdir;