From 340fda9b68cc040410fd62858ada1a323829d8ee Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 29 Mar 2011 16:38:53 +0000 Subject: [PATCH] Two hash_collections can only match if they have at least one matching hash. --- src/emu/hash.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/emu/hash.c b/src/emu/hash.c index 61092ce64af..5d55f26d642 100644 --- a/src/emu/hash.c +++ b/src/emu/hash.c @@ -441,15 +441,20 @@ hash_collection &hash_collection::operator=(const hash_collection &src) bool hash_collection::operator==(const hash_collection &rhs) const { // look for a mismatch in any hash; do not fail if one is missing + int matches = 0; for (hash_base *hash = m_hashlist.first(); hash != NULL; hash = hash->next()) { hash_base *rhs_hash = rhs.hash(hash->id()); - if (hash != NULL && rhs_hash != NULL && *hash != *rhs_hash) - return false; + if (hash != NULL) + { + if (rhs_hash != NULL && *hash != *rhs_hash) + return false; + matches++; + } } // if all shared hashes match, return true - return true; + return (matches > 0); }