mirror of
https://github.com/libretro/scummvm.git
synced 2024-11-27 03:10:37 +00:00
PLUGINS: Don't call plugin->getType repeatedly
This commit is contained in:
parent
2645b1431c
commit
5ded4aedec
@ -632,8 +632,9 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) {
|
|||||||
// The plugin is valid, see if it provides the same module as an
|
// The plugin is valid, see if it provides the same module as an
|
||||||
// already loaded one and should replace it.
|
// already loaded one and should replace it.
|
||||||
|
|
||||||
PluginList::iterator pl = _pluginsInMem[plugin->getType()].begin();
|
PluginList &list = _pluginsInMem[plugin->getType()];
|
||||||
while (!found && pl != _pluginsInMem[plugin->getType()].end()) {
|
PluginList::iterator pl = list.begin();
|
||||||
|
while (!found && pl != list.end()) {
|
||||||
if (!strcmp(plugin->getName(), (*pl)->getName())) {
|
if (!strcmp(plugin->getName(), (*pl)->getName())) {
|
||||||
// Found a duplicated module. Replace the old one.
|
// Found a duplicated module. Replace the old one.
|
||||||
found = true;
|
found = true;
|
||||||
@ -647,7 +648,7 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) {
|
|||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
// If it provides a new module, just add it to the list of known plugins in memory.
|
// If it provides a new module, just add it to the list of known plugins in memory.
|
||||||
_pluginsInMem[plugin->getType()].push_back(plugin);
|
list.push_back(plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user