summaryrefslogtreecommitdiff
path: root/lib/rpmps.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-25 12:34:06 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-25 12:34:06 +0200
commit833ea26c4660889a614e0808b7b1e725d255aa7e (patch)
treee50e841e4a109b6c1a1332653a2b961a0c0e9677 /lib/rpmps.c
parentab890ee23f17836daacda810378207fce84753b9 (diff)
downloadrpm-833ea26c4660889a614e0808b7b1e725d255aa7e.tar.gz
rpm-833ea26c4660889a614e0808b7b1e725d255aa7e.tar.bz2
rpm-833ea26c4660889a614e0808b7b1e725d255aa7e.zip
Dont bother allocating iterator if there's no data to iterate
Diffstat (limited to 'lib/rpmps.c')
-rw-r--r--lib/rpmps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmps.c b/lib/rpmps.c
index c19c4901f..cf2275de5 100644
--- a/lib/rpmps.c
+++ b/lib/rpmps.c
@@ -67,7 +67,7 @@ int rpmpsNumProblems(rpmps ps)
rpmpsi rpmpsInitIterator(rpmps ps)
{
rpmpsi psi = NULL;
- if (ps != NULL) {
+ if (ps != NULL && ps->numProblems > 0) {
psi = xcalloc(1, sizeof(*psi));
psi->ps = rpmpsLink(ps);
psi->ix = -1;