Depend on name_hash being set

This is a fairly valid assumption at this point, or at least as good of
one as assuming packages all have names.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-08-08 23:57:19 -05:00
parent 9d3d647f00
commit 40ea6cd607
2 changed files with 2 additions and 4 deletions

View File

@ -373,8 +373,7 @@ int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep)
int satisfy = 0;
/* check (pkg->name, pkg->version) */
if(pkg->name_hash && dep->name_hash
&& pkg->name_hash != dep->name_hash) {
if(pkg->name_hash != dep->name_hash) {
/* skip more expensive checks */
} else {
satisfy = (strcmp(pkg->name, dep->name) == 0

View File

@ -625,8 +625,7 @@ alpm_pkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle)
alpm_pkg_t *info = lp->data;
if(info) {
/* a zero hash will cause a fall-through just in case */
if(info->name_hash && info->name_hash != needle_hash) {
if(info->name_hash != needle_hash) {
continue;
}