diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-09-18 06:30:59 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-09-18 06:30:59 +0300 |
commit | b8e5a448c5f58a174d42e00136df01565c6d3e74 (patch) | |
tree | 3931f4f2aae3977a4a7b01a9ce35595993c8bd48 | |
parent | 272eaae387c72cac14eff8665eaa3126ca2dcc22 (diff) | |
download | librpm-tizen-b8e5a448c5f58a174d42e00136df01565c6d3e74.tar.gz librpm-tizen-b8e5a448c5f58a174d42e00136df01565c6d3e74.tar.bz2 librpm-tizen-b8e5a448c5f58a174d42e00136df01565c6d3e74.zip |
Avoid redundant ds -> id -> string lookups in rpmalAllFileSatisfiesDepend()
- We need to grab the dependency string in rpmalAllSatisfiesDepend()
already to see whether its a file dependency or not, just pass that
to the file deps to avoid redundant work.
-rw-r--r-- | lib/rpmal.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rpmal.c b/lib/rpmal.c index adab5fec7..948892fc3 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -304,10 +304,8 @@ static void rpmalMakeIndex(rpmal al) } } -static rpmte * rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds) +static rpmte * rpmalAllFileSatisfiesDepend(const rpmal al, const char *fileName) { - rpmsid fnId = rpmdsNId(ds); - const char *fileName = rpmstrPoolStr(al->pool, fnId); const char *slash; rpmte * ret = NULL; @@ -368,7 +366,7 @@ static rpmte * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds) name = rpmstrPoolStr(al->pool, nameId); if (!obsolete && *name == '/') { /* First, look for files "contained" in package ... */ - ret = rpmalAllFileSatisfiesDepend(al, ds); + ret = rpmalAllFileSatisfiesDepend(al, name); if (ret != NULL && *ret != NULL) { rpmdsNotify(ds, "(added files)", 0); return ret; |