optimized software_list_device::find() a bit - speeds up -validate for MESS (nw)

This commit is contained in:
Oliver Stöneberg 2014-04-07 09:46:36 +00:00
parent 0e35e130fd
commit c2ea61475b

View File

@ -539,9 +539,11 @@ software_info *software_list_device::find(const char *look_for, software_info *p
if (look_for == NULL)
return NULL;
bool iswild = strchr(look_for, '*') != NULL || strchr(look_for, '?');
// find a match (will cause a parse if needed when calling first_software_info)
for (prev = (prev != NULL) ? prev->next() : first_software_info(); prev != NULL; prev = prev->next())
if (core_strwildcmp(look_for, prev->shortname()) == 0)
if ((iswild && core_strwildcmp(look_for, prev->shortname()) == 0) || core_stricmp(look_for, prev->shortname()) == 0)
break;
return prev;