diff options
author | Dan McGee <dan@archlinux.org> | 2011-08-18 06:25:19 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-18 17:47:41 +0200 |
commit | c4bd476ad13e142fe8323fe74d84b3950b53da17 (patch) | |
tree | ddfd2afb08bf94b300eecee7cfef3394ed8c1092 /lib/libalpm/db.c | |
parent | c885a953eb888004f0302ed3eceafef93e2f072f (diff) | |
download | pacman-c4bd476ad13e142fe8323fe74d84b3950b53da17.tar.gz pacman-c4bd476ad13e142fe8323fe74d84b3950b53da17.tar.xz |
Remove use of no-op accessor functions in library
The functions alpm_db_get_name(), alpm_pkg_get_name(), and
alpm_pkg_get_version() are not necessary at all, so remove the calling
and indirection when used in the backend, which makes things slightly
more efficient and reduces code size.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r-- | lib/libalpm/db.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 8a235e21..77bdf98c 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -411,7 +411,7 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles) for(j = list; j; j = j->next) { alpm_pkg_t *pkg = j->data; const char *matched = NULL; - const char *name = alpm_pkg_get_name(pkg); + const char *name = pkg->name; const char *desc = alpm_pkg_get_desc(pkg); /* check name as regex AND as plain text */ @@ -559,7 +559,7 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) } _alpm_log(db->handle, ALPM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n", - alpm_pkg_get_name(newpkg), db->treename); + newpkg->name, db->treename); db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg); free_groupcache(db); @@ -576,13 +576,13 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg) } _alpm_log(db->handle, ALPM_LOG_DEBUG, "removing entry '%s' from '%s' cache\n", - alpm_pkg_get_name(pkg), db->treename); + pkg->name, db->treename); db->pkgcache = _alpm_pkghash_remove(db->pkgcache, pkg, &data); if(data == NULL) { /* package not found */ _alpm_log(db->handle, ALPM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found\n", - alpm_pkg_get_name(pkg), db->treename); + pkg->name, db->treename); return -1; } |