summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2011-07-25 16:38:19 +0000
committer smf- <smf-@users.noreply.github.com>2011-07-25 16:38:19 +0000
commite5ebc225d94986539228a47fd66b95fd8133a04f (patch)
tree1112a05eef397ba9d972619d35beb5700e09c7d0
parent8e84c1f225527955742424c80a72d52756a975f0 (diff)
optimized by only comparing the hashes if the length matches.
-rw-r--r--src/emu/audit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/emu/audit.c b/src/emu/audit.c
index 5164f57fe13..79870e94282 100644
--- a/src/emu/audit.c
+++ b/src/emu/audit.c
@@ -454,11 +454,12 @@ int media_auditor::also_used_by_parent(const hash_collection &romhashes, UINT64
for (const rom_source *source = rom_first_source(m_enumerator.config(drvindex)); source != NULL; source = rom_next_source(*source))
for (const rom_entry *region = rom_first_region(*source); region; region = rom_next_region(region))
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
- {
- hash_collection hashes(ROM_GETHASHDATA(rom));
- if (hashes == romhashes && ROM_GETLENGTH(rom) == romlength)
- return drvindex;
- }
+ if (ROM_GETLENGTH(rom) == romlength)
+ {
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ if (hashes == romhashes)
+ return drvindex;
+ }
// nope, return -1
return -1;