diff options
author | Colin Snover | 2017-05-20 19:50:56 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-20 21:14:18 -0500 |
commit | 881be25fcd82d765235e95ebf041a70ec1ae5ae5 (patch) | |
tree | 23adf16b40a0d539b8ff54b2119cc5f52ea760bb /engines/sci/console.cpp | |
parent | 66efb750a0ccaa3c2ff8b77f60544a345328da8b (diff) | |
download | scummvm-rg350-881be25fcd82d765235e95ebf041a70ec1ae5ae5.tar.gz scummvm-rg350-881be25fcd82d765235e95ebf041a70ec1ae5ae5.tar.bz2 scummvm-rg350-881be25fcd82d765235e95ebf041a70ec1ae5ae5.zip |
SCI: Stop making copies of ObjMap and remove related dead code
ObjMap owns Objects, so every time this map gets copied instead of
referenced, it creates a copy of every single object in the
associated script. This is expensive, and it breaks things like
the `Object::syncBaseObject` call in savegame.cpp, which hasn't
actually been doing anything since
58190c36b4cc84b3200239211d91b0291301db56 because it has been
operating on copies.
Diffstat (limited to 'engines/sci/console.cpp')
-rw-r--r-- | engines/sci/console.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index bc115341b7..0e90f22eba 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -2175,11 +2175,11 @@ bool Console::segmentInfo(int nr) { else debugPrintf(" Locals : none\n"); - ObjMap objects = scr->getObjectMap(); + const ObjMap &objects = scr->getObjectMap(); debugPrintf(" Objects: %4d\n", objects.size()); - ObjMap::iterator it; - const ObjMap::iterator end = objects.end(); + ObjMap::const_iterator it; + const ObjMap::const_iterator end = objects.end(); for (it = objects.begin(); it != end; ++it) { debugPrintf(" "); // Object header @@ -3546,9 +3546,9 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) { script = customSegMan->getScript(scriptSegment); // Iterate through all the script's objects - ObjMap objects = script->getObjectMap(); - ObjMap::iterator it; - const ObjMap::iterator end = objects.end(); + const ObjMap &objects = script->getObjectMap(); + ObjMap::const_iterator it; + const ObjMap::const_iterator end = objects.end(); for (it = objects.begin(); it != end; ++it) { const Object *obj = customSegMan->getObject(it->_value.getPos()); const char *objName = customSegMan->getObjectName(it->_value.getPos()); |