Skip to content

Commit

Permalink
Fix a horrible performance regression caused by missing &
Browse files Browse the repository at this point in the history
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 08a6a5e.
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.
  • Loading branch information
pmatilai committed Nov 1, 2024
1 parent 78cecdc commit b872d4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fprint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b872d4d

Please sign in to comment.