From e2a126d95892f5eb786160c90a16cd6797c846f8 Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 25 Jul 2018 13:55:36 +0200 Subject: Do not sort generated functions alphabetical Fixes #39 --- cpp/src/Slice/Parser.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'cpp/src/Slice/Parser.cpp') diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index b3140e5a4ad..cdffbbea280 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -3989,14 +3989,26 @@ Slice::ClassDef::operations() const OperationList Slice::ClassDef::allOperations() const { - OperationList result = operations(); - result.sort(); - result.unique(); + OperationList result; for(ClassList::const_iterator p = _bases.begin(); p != _bases.end(); ++p) { OperationList li = (*p)->allOperations(); - result.merge(li); - result.unique(); + for(OperationList::const_iterator q = li.begin(); q != li.end(); ++q) + { + if(find(result.begin(), result.end(), *q) == result.end()) + { + result.push_back(*q); + } + } + } + + OperationList li = operations(); + for(OperationList::const_iterator q = li.begin(); q != li.end(); ++q) + { + if(find(result.begin(), result.end(), *q) == result.end()) + { + result.push_back(*q); + } } return result; } -- cgit v1.2.3