summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-13 09:15:38 +0100
committerAaron Griffin <aaron@archlinux.org>2007-02-13 09:15:38 +0100
commit103dbb9fd14fde35e116819808e6d4c9b534eaa2 (patch)
tree05e1b6c6f4db530894c6e19694a846975ed6587f /lib/libalpm/remove.c
parent3da9fb537a0711ee12f66421703e5529ea5fca6a (diff)
downloadpacman-103dbb9fd14fde35e116819808e6d4c9b534eaa2.tar.gz
pacman-103dbb9fd14fde35e116819808e6d4c9b534eaa2.tar.xz
* Refactored conflict checking within packages. Profiling from Dan showed an
unbelievable amount of strcmp() calls (25 million) due to the list searching. This has been reimplemented with a set-intersection scheme, due to the fact that file lists are always ordered. - NEEDS TESTING * Minor clean up, "globalized" the str_cmp helper to match the alpm comparison signature, so we can use it elsewhere.
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index f230dfa7..7aaae2e6 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -155,14 +155,6 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
return(0);
}
-/* Helper function for comparing strings
- */
-static int str_cmp(const void *s1, const void *s2)
-{
- return(strcmp(s1, s2));
-}
-
-
static int can_remove_file(const char *path)
{
alpm_list_t *i;
@@ -378,7 +370,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
/* Ensure package has the appropriate data */
_alpm_db_read(db, INFRQ_DEPENDS, depinfo);
/* splice out this entry from requiredby */
- depinfo->requiredby = alpm_list_remove(depinfo->requiredby, info->name, str_cmp, &vdata);
+ depinfo->requiredby = alpm_list_remove(depinfo->requiredby, info->name, _alpm_str_cmp, &vdata);
data = vdata;
FREE(data);
_alpm_log(PM_LOG_DEBUG, _("updating 'requiredby' field for package '%s'"), depinfo->name);