diff options
author | richiesams | 2013-08-02 15:31:35 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:33:04 -0500 |
commit | 93e4f4dbf7cb6868e790d877ba01678ba19a8fbb (patch) | |
tree | 8ee38d6043b62d8a5684fe2e0e1b923b7f100fb1 /engines | |
parent | 2faaf8488bb5bdace2c017b37f825bc38f41ef84 (diff) | |
download | scummvm-rg350-93e4f4dbf7cb6868e790d877ba01678ba19a8fbb.tar.gz scummvm-rg350-93e4f4dbf7cb6868e790d877ba01678ba19a8fbb.tar.bz2 scummvm-rg350-93e4f4dbf7cb6868e790d877ba01678ba19a8fbb.zip |
ZVISION: Sort using iterators instead of the actual elements
Also convert the argument to a reference instead of a pointer
Diffstat (limited to 'engines')
-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); } } } |