mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
(nw) Removed duplicates from list of approximate software matches.
This commit is contained in:
parent
3ad2d8f34f
commit
3b3ef88bfe
@ -155,6 +155,16 @@ void software_list_device::find_approx_matches(const std::string &name, int matc
|
||||
int shortpenalty = driver_list::penalty_compare(name.c_str(), swinfo.shortname().c_str());
|
||||
int curpenalty = std::min(longpenalty, shortpenalty);
|
||||
|
||||
// make sure it isn't already in the table
|
||||
bool skip = false;
|
||||
for (int matchnum = 0; matchnum < matches; matchnum++)
|
||||
{
|
||||
if ((penalty[matchnum] == curpenalty) && (swinfo.longname() == list[matchnum]->longname()) && (swinfo.shortname() == list[matchnum]->shortname()))
|
||||
skip = true;
|
||||
}
|
||||
|
||||
if (!skip)
|
||||
{
|
||||
// insert into the sorted table of matches
|
||||
for (int matchnum = matches - 1; matchnum >= 0; matchnum--)
|
||||
{
|
||||
@ -174,6 +184,7 @@ void software_list_device::find_approx_matches(const std::string &name, int matc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user