diff options
-rw-r--r-- | engines/zvision/script_manager.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/utility.h | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/zvision/script_manager.cpp b/engines/zvision/script_manager.cpp index 540971ad8b..cd4e174a7c 100644 --- a/engines/zvision/script_manager.cpp +++ b/engines/zvision/script_manager.cpp @@ -56,7 +56,7 @@ void ScriptManager::createReferenceTable() { // Remove duplicate entries for (Common::HashMap<uint32, Common::Array<Puzzle *> >::iterator referenceTableIter = _referenceTable.begin(); referenceTableIter != _referenceTable.end(); referenceTableIter++) { - removeDuplicateEntries(&(referenceTableIter->_value)); + removeDuplicateEntries(referenceTableIter->_value); } } diff --git a/engines/zvision/utility.h b/engines/zvision/utility.h index 9cc0d1e4e1..8974809f97 100644 --- a/engines/zvision/utility.h +++ b/engines/zvision/utility.h @@ -67,12 +67,12 @@ void dumpEveryResultAction(const Common::String &destFile); * @return */ template<class T> -void removeDuplicateEntries(Common::Array<T> *container) { - Common::sort(container->front(), container->back()); +void removeDuplicateEntries(Common::Array<T> &container) { + Common::sort(container.begin(), container.end()); - for (uint i = 0; i < container->size(); i++) { - while (container[i] == container[i +1]) { - container->remove_at(i + 1); + for (uint i = 0; i + 1 < container.size(); i++) { + while (container[i] == container[i + 1]) { + container.remove_at(i + 1); } } } |