summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-28 19:48:53 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:06 -0300
commit51cd6edb17866dbfe96990e3db15273d6d26bf75 (patch)
tree1e99ffecbbf79781888f0628f6b66ac8d6ec2605
parent068900d4f0af107e03dca9b530fff47deac4066d (diff)
Fixes usage of std::unique method.
std::unique looks for adjacent duplicates in a list, so it needs to be sorted for the algorithm to work in all items.
-rw-r--r--abstractmetabuilder.cpp1
-rw-r--r--parser/codemodel.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index fe310cf1..41a8b953 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -337,6 +337,7 @@ bool AbstractMetaBuilder::build(QIODevice* input)
// Start the generation...
ClassList typeValues = typeMap.values();
+ qSort(typeValues);
ClassList::iterator it = std::unique(typeValues.begin(), typeValues.end());
typeValues.erase(it, typeValues.end());
diff --git a/parser/codemodel.cpp b/parser/codemodel.cpp
index 861a6708..41947150 100644
--- a/parser/codemodel.cpp
+++ b/parser/codemodel.cpp
@@ -373,6 +373,7 @@ FunctionModelItem _ScopeModelItem::declaredFunction(FunctionModelItem item)
ClassList _ScopeModelItem::classes() const
{
ClassList result = _M_classes.values();
+ qSort(result);
ClassList::iterator it = std::unique(result.begin(), result.end());
result.erase(it, result.end());
return result;