From c2ea61475b10d4c9e59b02b92c6c5852af4ad378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Mon, 7 Apr 2014 09:46:36 +0000 Subject: [PATCH] optimized software_list_device::find() a bit - speeds up -validate for MESS (nw) --- src/emu/softlist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emu/softlist.c b/src/emu/softlist.c index 27c857a383c..d031b3041aa 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -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;