From 1dcb8076db64420ab28722a73583f89b38314e71 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Thu, 10 May 2018 09:26:26 +0200 Subject: ENGINES: Remove usage of C++11 extended initializer lists --- base/plugins.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'base') diff --git a/base/plugins.cpp b/base/plugins.cpp index 40a4d77053..023f2f3bb3 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -459,11 +459,9 @@ DECLARE_SINGLETON(EngineManager); * and only if we can't find it there, we loop through the plugins. **/ PlainGameDescriptor EngineManager::findGame(const Common::String &gameName, const Plugin **plugin) const { - PlainGameDescriptor result; - // First look for the game using the plugins in memory. This is critical // for calls coming from inside games - result = findGameInLoadedPlugins(gameName, plugin); + PlainGameDescriptor result = findGameInLoadedPlugins(gameName, plugin); if (result.gameId) { return result; } @@ -497,7 +495,6 @@ PlainGameDescriptor EngineManager::findGame(const Common::String &gameName, cons PlainGameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin) const { // Find the GameDescriptor for this target const PluginList &plugins = getPlugins(); - PlainGameDescriptor result; if (plugin) *plugin = 0; @@ -505,14 +502,15 @@ PlainGameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String PluginList::const_iterator iter; for (iter = plugins.begin(); iter != plugins.end(); ++iter) { - result = (*iter)->get().findGame(gameName.c_str()); - if (result.gameId) { + PlainGameDescriptor pgd = (*iter)->get().findGame(gameName.c_str()); + if (pgd.gameId) { if (plugin) *plugin = *iter; - return result; + return pgd; } } - return result; + + return PlainGameDescriptor::empty(); } DetectionResults EngineManager::detectGames(const Common::FSList &fslist) const { -- cgit v1.2.3