aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2012-01-15 21:42:09 +0200
committerFilippos Karapetis2012-01-15 21:42:09 +0200
commit7560007ba9becb824c9a107b65f6a630daea9e58 (patch)
treeab8c0d401b5e4d36fb62cff2504bdd7140685f71 /engines/sci
parentc69ac88be24feb733c74967d367e469e4d90913b (diff)
downloadscummvm-rg350-7560007ba9becb824c9a107b65f6a630daea9e58.tar.gz
scummvm-rg350-7560007ba9becb824c9a107b65f6a630daea9e58.tar.bz2
scummvm-rg350-7560007ba9becb824c9a107b65f6a630daea9e58.zip
SCI: Simplify kString(Dup) using the overloaded = operator
Thanks to wjp for his suggestion
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kstring.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 03359b48c1..089ba0e65b 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -752,14 +752,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) {
SciString *dupString = s->_segMan->allocateString(&stringHandle);
if (argv[1].segment == s->_segMan->getStringSegmentId()) {
- SciString *sciString = s->_segMan->lookupString(argv[1]);
- const char *rawString = sciString->getRawData();
- uint32 size = sciString->getSize();
-
- dupString->setSize(sciString->getSize());
-
- for (uint32 i = 0; i < size; i++)
- dupString->setValue(i, rawString[i]);
+ *dupString = *s->_segMan->lookupString(argv[1]);
} else {
dupString->fromString(s->_segMan->getString(argv[1]));
}