Minor optimization on likely sync package lookup
We have a name_hash value here, so add a cheap compare of it before falling to the strcmp() call. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
29e94dc065
commit
177beb91c9
1 changed files with 2 additions and 1 deletions
|
@ -318,7 +318,8 @@ static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(likely_pkg && strcmp(likely_pkg->name, pkgname) == 0) {
|
if(likely_pkg && pkgname_hash == likely_pkg->name_hash
|
||||||
|
&& strcmp(likely_pkg->name, pkgname) == 0) {
|
||||||
pkg = likely_pkg;
|
pkg = likely_pkg;
|
||||||
} else {
|
} else {
|
||||||
pkg = _alpm_pkghash_find(db->pkgcache, pkgname);
|
pkg = _alpm_pkghash_find(db->pkgcache, pkgname);
|
||||||
|
|
Loading…
Add table
Reference in a new issue