summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-24 10:49:19 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-27 14:55:11 +0300
commitebc4ceaaeb8bb59019f4635471b28eb5f3eaaaa6 (patch)
tree32972bc81490bf3ffb299903566d4527dfb534fe /rpmio
parentccba5236a05b5680b93e12f24c3d2e14c5385b7d (diff)
downloadrpm-ebc4ceaaeb8bb59019f4635471b28eb5f3eaaaa6.tar.gz
rpm-ebc4ceaaeb8bb59019f4635471b28eb5f3eaaaa6.tar.bz2
rpm-ebc4ceaaeb8bb59019f4635471b28eb5f3eaaaa6.zip
Avoid unnecessary round-trip through expandT() where possible
- In the cases where expandT() was called with strlen(source) we can now just bypass it and call expandMacro() directly, avoiding an unnecessary string copy.
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/macro.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 4bbed46b1..8b8ce592f 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -1008,7 +1008,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
}
if (b) {
- (void) expandT(mb, b, strlen(b));
+ (void) expandMacro(mb, b);
}
free(buf);
}
@@ -1285,7 +1285,7 @@ expandMacro(MacroBuf mb, const char *src)
rc = expandT(mb, g, gn);
} else
if (me && me->body && *me->body) {/* Expand %{-f}/%{-f*} */
- rc = expandT(mb, me->body, strlen(me->body));
+ rc = expandMacro(mb, me->body);
}
s = se;
continue;
@@ -1302,7 +1302,7 @@ expandMacro(MacroBuf mb, const char *src)
rc = expandT(mb, g, gn);
} else
if (me && me->body && *me->body) { /* Expand %{?f}/%{?f*} */
- rc = expandT(mb, me->body, strlen(me->body));
+ rc = expandMacro(mb, me->body);
}
s = se;
continue;