index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2012-07-10 22:51:41 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-08-01 08:53:10 -0500 |
commit | 35ac4e7ef31898b4d8a090c687aad63df1436083 (patch) | |
tree | 3fc505cca0a7f6a2723ac18cd43aa23dd210d717 | |
parent | c5e7eeece75e2774d304116bc5003371cc8f1e8e (diff) |
-rw-r--r-- | lib/libalpm/conflict.c | 13 |
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 7494fd77..fd4eff13 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -315,19 +315,16 @@ void _alpm_fileconflict_free(alpm_fileconflict_t *conflict) const alpm_file_t *_alpm_filelist_contains(alpm_filelist_t *filelist, const char *name) { - size_t i; - const alpm_file_t *file; + alpm_file_t key; if(!filelist) { return NULL; } - for(file = filelist->files, i = 0; i < filelist->count; file++, i++) { - if(strcmp(file->name, name) == 0) { - return file; - } - } - return NULL; + key.name = (char *)name; + + return bsearch(&key, filelist->files, filelist->count, + sizeof(alpm_file_t), _alpm_files_cmp); } static int dir_belongsto_pkg(alpm_handle_t *handle, const char *dirpath, |