From c4bd476ad13e142fe8323fe74d84b3950b53da17 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 17 Aug 2011 23:25:19 -0500 Subject: 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 --- lib/libalpm/package.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/package.c') 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; } -- cgit v1.2.3-24-g4f1b