From f006eddac56fdf4305a3d63914245b8707210725 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 24 Jul 2012 23:32:17 +0200 Subject: GUI: Let SaveLoadChooser::getResultString return a const reference. --- gui/saveload.cpp | 8 +++----- gui/saveload.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'gui') diff --git a/gui/saveload.cpp b/gui/saveload.cpp index 0650be388c..d6a8688ce3 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -103,11 +103,9 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con return ret; } -Common::String SaveLoadChooser::getResultString() const { - if (_impl) - return _impl->getResultString(); - else - return Common::String(); +const Common::String &SaveLoadChooser::getResultString() const { + assert(_impl); + return _impl->getResultString(); } } // End of namespace GUI diff --git a/gui/saveload.h b/gui/saveload.h index 26a8cd1bad..17fd99a31d 100644 --- a/gui/saveload.h +++ b/gui/saveload.h @@ -52,7 +52,7 @@ public: int runModalWithCurrentTarget(); int runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target); - Common::String getResultString() const; + const Common::String &getResultString() const; /** * Creates a default save description for the specified slot. Depending -- cgit v1.2.3