[Rpm-maint] [rpm-software-management/rpm] Add rpmlogOnce() and rpmlogReset() (PR #3417)

Panu Matilainen notifications at github.com
Fri Nov 1 07:06:36 UTC 2024


@pmatilai commented on this pull request.



> @@ -22,6 +23,7 @@ struct rpmlogCtx_s {
     unsigned mask;
     int nrecsPri[RPMLOG_NPRIS];
     std::vector<rpmlogRec_s> recs;
+    std::map<uint64_t, std::map<std::pair<int, std::string>, int>> seen;

Something that occurred to me last evening after work: this would be better off with unordered_map for both maps, which is STL's kind of exotic name for what the industry knows as a hash map, std::map maintains things in sort order at all times. Both work but unordered is (obviously) somewhat faster when you don't need the sorted iteration etc.

Not that it'll matter much here because there'll be only a handful of items in either map for the foreseeable future. So not a review requirement (although changing is trivial because both maps dance to the same exact API), just .. maybe education :sweat_smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3417#pullrequestreview-2409571315
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3417/review/2409571315 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241101/c4cb4ce6/attachment.html>


More information about the Rpm-maint mailing list