diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-03-16 02:07:49 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2014-03-16 02:07:49 -0400 |
commit | 8f59ad7b9e732fa41f29c9c23ea42f68546d32ec (patch) | |
tree | fcc472ca1642cae935f779b56ab8d7e0b798fa6a /qlist.c | |
parent | tests: qdepends: add a -Q test (diff) | |
download | portage-utils-8f59ad7b9e732fa41f29c9c23ea42f68546d32ec.tar.gz portage-utils-8f59ad7b9e732fa41f29c9c23ea42f68546d32ec.tar.bz2 portage-utils-8f59ad7b9e732fa41f29c9c23ea42f68546d32ec.zip |
qlist: speed up -U flag slightly
No need to clear the whole buffer when we use this as a normal C string.
Diffstat (limited to 'qlist.c')
-rw-r--r-- | qlist.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -56,7 +56,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV) if ((use = grab_vdb_item("USE", CAT, PV)) == NULL) return NULL; - memset(umap, 0, sizeof(umap)); /* reset the buffer */ + umap[0] = '\0'; /* reset the buffer */ /* grab_vdb is a static function so save it to memory right away */ makeargv(use, &use_argc, &use_argv); @@ -85,8 +85,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV) sets = del_set(use_argv[i], sets, &ok); sets = add_set(use_argv[i], use_argv[i], sets); } - memset(umap, 0, sizeof(umap)); /* reset the buffer */ - strcpy(umap, ""); + umap[0] = '\0'; /* reset the buffer */ for (ll = sets; ll != NULL; ll = ll->next) { strncat(umap, ll->name, sizeof(umap)-strlen(umap)-1); strncat(umap, " ", sizeof(umap)-strlen(umap)-1); |