mirror of
https://github.com/holub/mame
synced 2025-04-27 02:33:13 +03:00
optimized by only comparing the hashes if the length matches.
This commit is contained in:
parent
8e84c1f225
commit
e5ebc225d9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user