Use headerNextTag() for header format iteration
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 22 Sep 2010 11:28:32 +0000 (14:28 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 22 Sep 2010 11:28:32 +0000 (14:28 +0300)
- Doesn't really win anything performance-wise but makes the code nicer

lib/headerfmt.c

index e25f13a..33c7296 100644 (file)
@@ -172,13 +172,9 @@ static sprintfToken hsaNext(headerSprintfArgs hsa)
        if (hsa->hi == NULL) {
            hsa->i++;
        } else {
-           struct rpmtd_s td;
-
-           /* hmm, cache the data from here too? */
-           if (!headerNext(hsa->hi, &td))
+           tag->tag = headerNextTag(hsa->hi);
+           if (tag->tag == RPMTAG_NOT_FOUND)
                fmt = NULL;
-           tag->tag = td.tag;
-           rpmtdFreeData(&td);
        }
     }