aboutsummaryrefslogtreecommitdiff
path: root/gui/theme-config.cpp
diff options
context:
space:
mode:
authorMax Horn2006-06-03 13:33:39 +0000
committerMax Horn2006-06-03 13:33:39 +0000
commit76116f36dd946ee49863a356f03eac8a05f22dcb (patch)
tree88e02bbb766096c6d24022eac5c4c636e8144655 /gui/theme-config.cpp
parent50cbb8ca809e7e2d6320e72232b4849180cc6f3e (diff)
downloadscummvm-rg350-76116f36dd946ee49863a356f03eac8a05f22dcb.tar.gz
scummvm-rg350-76116f36dd946ee49863a356f03eac8a05f22dcb.tar.bz2
scummvm-rg350-76116f36dd946ee49863a356f03eac8a05f22dcb.zip
*Loads* of Common::String related optimizations. Woa, *tons* of methods were copying strings needlessly
svn-id: r22873
Diffstat (limited to 'gui/theme-config.cpp')
-rw-r--r--gui/theme-config.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index fbc0575f89..2e69d6da1b 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -407,7 +407,7 @@ const char *Theme::_defaultConfigINI =
using Common::String;
-void Theme::processSingleLine(const String &section, const String prefix, const String name, const String str) {
+void Theme::processSingleLine(const String &section, const String &prefix, const String &name, const String &str) {
int level = 0;
int start = 0;
uint i;
@@ -470,7 +470,7 @@ void Theme::processSingleLine(const String &section, const String prefix, const
}
-void Theme::processResSection(Common::ConfigFile &config, String name, bool skipDefs, const String prefix) {
+void Theme::processResSection(Common::ConfigFile &config, const String &name, bool skipDefs, const String &prefix) {
debug(3, "Reading section: [%s]", name.c_str());
const Common::ConfigFile::SectionKeyList &keys = config.getKeys(name);
@@ -509,13 +509,12 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip
if (iterk->key == "useWithPrefix") {
const char *temp = iterk->value.c_str();
const char *pos = strrchr(temp, ' ');
- String n, pref;
if (pos == NULL)
error("2 arguments required for useWithPrefix keyword");
- n = String(temp, strchr(temp, ' ') - temp);
- pref = String(pos + 1);
+ String n(temp, strchr(temp, ' ') - temp);
+ String pref(pos + 1);
if (n == name)
error("Theme section [%s]: cannot use itself", n.c_str());
@@ -528,15 +527,13 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip
}
}
-void Theme::setSpecialAlias(const String alias, const String &name) {
+void Theme::setSpecialAlias(const String &alias, const String &name) {
const char *postfixes[] = {".x", ".y", ".w", ".h", ".x2", ".y2"};
int i;
for (i = 0; i < ARRAYSIZE(postfixes); i++) {
- String from, to;
-
- from = alias + postfixes[i];
- to = name + postfixes[i];
+ String from(alias + postfixes[i]);
+ String to(name + postfixes[i]);
_evaluator->setAlias(from.c_str(), to);
}