aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-08-02 15:31:35 -0500
committerrichiesams2013-08-04 13:33:04 -0500
commit93e4f4dbf7cb6868e790d877ba01678ba19a8fbb (patch)
tree8ee38d6043b62d8a5684fe2e0e1b923b7f100fb1 /engines
parent2faaf8488bb5bdace2c017b37f825bc38f41ef84 (diff)
downloadscummvm-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.cpp2
-rw-r--r--engines/zvision/utility.h10
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);
}
}
}