aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2011-10-23 20:02:35 +0200
committerJohannes Schickel2011-10-23 20:04:03 +0200
commit3a196478c69b635c7c1c2d121b30d9710f8bd1e5 (patch)
tree2fdf78e3a0b0756279164b9f7abc683c13cab619
parenta41d72a44a660c72fdadbc3a8ef580e5e03cb890 (diff)
downloadscummvm-rg350-3a196478c69b635c7c1c2d121b30d9710f8bd1e5.tar.gz
scummvm-rg350-3a196478c69b635c7c1c2d121b30d9710f8bd1e5.tar.bz2
scummvm-rg350-3a196478c69b635c7c1c2d121b30d9710f8bd1e5.zip
ALL: Reduce assignment of "" to Common::String.
When clearing an existant object clear() should be used. When constructing objects (or using default values for parameters) the constructor of String without any argument should be used. This changes only a few instances I noticed while looking over some recent commit logs.
-rw-r--r--audio/mididrv.cpp2
-rw-r--r--common/util.cpp2
-rw-r--r--engines/game.h4
-rw-r--r--gui/options.cpp4
-rw-r--r--gui/saveload.cpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp
index f638250dcd..829bc3cd55 100644
--- a/audio/mididrv.cpp
+++ b/audio/mididrv.cpp
@@ -74,7 +74,7 @@ static const struct {
};
Common::String MidiDriver::musicType2GUIO(uint32 musicType) {
- Common::String res = "";
+ Common::String res;
for (int i = 0; GUIOMapping[i].guio; i++) {
if (musicType == GUIOMapping[i].type || musicType == (uint32)-1)
diff --git a/common/util.cpp b/common/util.cpp
index bd2ebc4937..1f1b8a1440 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -381,7 +381,7 @@ String parseGameGUIOptions(const String &str) {
}
const String getGameGUIOptionsDescription(const String &options) {
- String res = "";
+ String res;
for (int i = 0; g_gameOptions[i].desc; i++)
if (options.contains(g_gameOptions[i].option[0]))
diff --git a/engines/game.h b/engines/game.h
index 23512e89b8..d5136936bc 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -65,12 +65,12 @@ enum GameSupportLevel {
class GameDescriptor : public Common::StringMap {
public:
GameDescriptor();
- GameDescriptor(const PlainGameDescriptor &pgd, Common::String guioptions = "");
+ GameDescriptor(const PlainGameDescriptor &pgd, Common::String guioptions = Common::String());
GameDescriptor(const Common::String &gameid,
const Common::String &description,
Common::Language language = Common::UNK_LANG,
Common::Platform platform = Common::kPlatformUnknown,
- Common::String guioptions = "",
+ Common::String guioptions = Common::String(),
GameSupportLevel gsl = kStableGame);
/**
diff --git a/gui/options.cpp b/gui/options.cpp
index 67204fc343..ad2e3d92d0 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -141,7 +141,7 @@ void OptionsDialog::init() {
_oldTheme = g_gui.theme()->getThemeId();
// Retrieve game GUI options
- _guioptions = "";
+ _guioptions.clear();
if (ConfMan.hasKey("guioptions", _domain)) {
_guioptionsString = ConfMan.get("guioptions", _domain);
_guioptions = parseGameGUIOptions(_guioptionsString);
@@ -155,7 +155,7 @@ void OptionsDialog::open() {
setResult(0);
// Retrieve game GUI options
- _guioptions = "";
+ _guioptions.clear();
if (ConfMan.hasKey("guioptions", _domain)) {
_guioptionsString = ConfMan.get("guioptions", _domain);
_guioptions = parseGameGUIOptions(_guioptionsString);
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index ae950a21fb..3dc9961906 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -92,7 +92,7 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con
_thumbnailSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportThumbnail);
_saveDateSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportCreationDate);
_playTimeSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportPlayTime);
- _resultString = "";
+ _resultString.clear();
reflowLayout();
updateSaveList();