Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-17 23:25:19 -0500
committerDan McGee <dan@archlinux.org>2011-08-18 10:47:41 -0500
commitc4bd476ad13e142fe8323fe74d84b3950b53da17 (patch)
treeddfd2afb08bf94b300eecee7cfef3394ed8c1092 /lib/libalpm/package.c
parentc885a953eb888004f0302ed3eceafef93e2f072f (diff)
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/package.c')
-rw-r--r--lib/libalpm/package.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index a88af5e2..a31effbc 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -618,8 +618,7 @@ void _alpm_pkg_free_trans(alpm_pkg_t *pkg)
/* Is spkg an upgrade for localpkg? */
int _alpm_pkg_compare_versions(alpm_pkg_t *spkg, alpm_pkg_t *localpkg)
{
- return alpm_pkg_vercmp(alpm_pkg_get_version(spkg),
- alpm_pkg_get_version(localpkg));
+ return alpm_pkg_vercmp(spkg->version, localpkg->version);
}
/* Helper function for comparing packages
@@ -677,7 +676,7 @@ int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg)
alpm_list_t *groups = NULL;
/* first see if the package is ignored */
- if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(pkg))) {
+ if(alpm_list_find_str(handle->ignorepkg, pkg->name)) {
return 1;
}