diff options
Diffstat (limited to 'engines/zvision/utility.h')
-rw-r--r-- | engines/zvision/utility.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/zvision/utility.h b/engines/zvision/utility.h index 43d28df6c9..e5713fc7f4 100644 --- a/engines/zvision/utility.h +++ b/engines/zvision/utility.h @@ -56,7 +56,19 @@ void trimCommentsAndWhiteSpace(Common::String *string); */ void dumpEveryResultAction(const Common::String &destFile); +/** + * Removes all duplicate entries from container. + * + * @param container + * @return + */ +template<class T> +void removeDuplicateEntries(Common::Array<T> *container) { + Common::sort(container->front(), container->back()); + for (int i = 0; i < container->size(); i++) { + while (container[i] == container[i +1]) { + container->remove_at(i + 1); } } } |