[Rpm-maint] [rpm-software-management/rpm] rpmte: Move dependencies into an unordered_map (PR #3538)
Panu Matilainen
notifications at github.com
Mon Jan 27 09:51:01 UTC 2025
@pmatilai commented on this pull request.
> - p->provides = rpmdsNewPool(tspool, h, RPMTAG_PROVIDENAME, 0);
- p->requires_ = rpmdsNewPool(tspool, h, RPMTAG_REQUIRENAME, 0);
- p->conflicts = rpmdsNewPool(tspool, h, RPMTAG_CONFLICTNAME, 0);
- p->obsoletes = rpmdsNewPool(tspool, h, RPMTAG_OBSOLETENAME, 0);
- p->order = rpmdsNewPool(tspool, h, RPMTAG_ORDERNAME, 0);
- p->recommends = rpmdsNewPool(tspool, h, RPMTAG_RECOMMENDNAME, 0);
- p->suggests = rpmdsNewPool(tspool, h, RPMTAG_SUGGESTNAME, 0);
- p->supplements = rpmdsNewPool(tspool, h, RPMTAG_SUPPLEMENTNAME, 0);
- p->enhances = rpmdsNewPool(tspool, h, RPMTAG_ENHANCENAME, 0);
+ p->dependencies[RPMTAG_NAME] = \
+ rpmdsThisPool(tspool, h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL);
+ for (rpmTagVal tag : {
+ RPMTAG_PROVIDENAME, RPMTAG_SUPPLEMENTNAME, RPMTAG_ENHANCENAME,
+ RPMTAG_REQUIRENAME, RPMTAG_RECOMMENDNAME, RPMTAG_SUGGESTNAME,
+ RPMTAG_CONFLICTNAME, RPMTAG_OBSOLETENAME, RPMTAG_ORDERNAME
+ }) {
Don't use code for what you can easily put into a data structure. Here's a nice opportunity to do just that.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3538#pullrequestreview-2574965976
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3538/review/2574965976 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250127/df6bb419/attachment.htm>
More information about the Rpm-maint
mailing list