From 9ade3bdb298e763e197f9be1a6c3ff9455174ae7 Mon Sep 17 00:00:00 2001 From: Austin Henriksen Date: Tue, 7 Jan 2025 11:34:26 -0500 Subject: [PATCH] Removed sorting of operation name lists (except in C++). --- cpp/src/Slice/Parser.cpp | 1 - cpp/src/ice2slice/Gen.cpp | 2 -- cpp/src/slice2cs/Gen.cpp | 31 +++++++++++++------------------ cpp/src/slice2java/Gen.cpp | 2 -- cpp/src/slice2js/Gen.cpp | 1 - cpp/src/slice2matlab/Main.cpp | 1 - cpp/src/slice2swift/Gen.cpp | 2 -- 7 files changed, 13 insertions(+), 27 deletions(-) diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 9236bdac22f..117b51ac454 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -3053,7 +3053,6 @@ Slice::InterfaceDef::allBases() const { InterfaceList result = _bases; result.sort(containedCompare); - result.unique(containedEqual); for (const auto& p : _bases) { result.merge(p->allBases(), containedCompare); diff --git a/cpp/src/ice2slice/Gen.cpp b/cpp/src/ice2slice/Gen.cpp index 9d76f7e5aa0..98608b7e950 100644 --- a/cpp/src/ice2slice/Gen.cpp +++ b/cpp/src/ice2slice/Gen.cpp @@ -561,8 +561,6 @@ Gen::TypesVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p) } ExceptionList throws = op->throws(); - throws.sort(); - throws.unique(); if (throws.size() == 1) { out << " throws " << getUnqualified(throws.front(), scope); diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 5cca67555ab..ed24682429c 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -317,25 +317,20 @@ Slice::CsVisitor::writeUnmarshalDataMember( void Slice::CsVisitor::writeInheritedOperations(const InterfaceDefPtr& p) { - InterfaceList bases = p->bases(); - if (!bases.empty()) + OperationList allBaseOps; + for (const auto& base : p->bases()) { - OperationList allOps; - for (InterfaceList::const_iterator q = bases.begin(); q != bases.end(); ++q) - { - OperationList tmp = (*q)->allOperations(); - allOps.splice(allOps.end(), tmp); - } - allOps.sort(); - allOps.unique(); - for (OperationList::const_iterator i = allOps.begin(); i != allOps.end(); ++i) - { - string retS; - vector params, args; - string ns = getNamespace(p); - string name = getDispatchParams(*i, retS, params, args, ns); - _out << sp << nl << "public abstract " << retS << " " << name << spar << params << epar << ';'; - } + OperationList tmp = base->allOperations(); + allBaseOps.splice(allBaseOps.end(), tmp); + } + + for (const auto& op : allBaseOps) + { + string retS; + vector params, args; + string ns = getNamespace(p); + string name = getDispatchParams(op, retS, params, args, ns); + _out << sp << nl << "public abstract " << retS << " " << name << spar << params << epar << ';'; } } diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index d8ecb77793b..9b7d235794a 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -3954,8 +3954,6 @@ Slice::Gen::ProxyVisitor::ProxyVisitor(const string& dir) : JavaVisitor(dir) {} bool Slice::Gen::ProxyVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p) { - const OperationList ops = p->allOperations(); - string name = p->name(); InterfaceList bases = p->bases(); string package = getPackage(p); diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp index 305c571c940..733746cd106 100644 --- a/cpp/src/slice2js/Gen.cpp +++ b/cpp/src/slice2js/Gen.cpp @@ -2036,7 +2036,6 @@ Slice::Gen::TypeScriptImportVisitor::visitInterfaceDefStart(const InterfaceDefPt } // Add imports required for operation parameters and return types. - const OperationList operationList = p->allOperations(); for (const auto& op : p->allOperations()) { auto ret = dynamic_pointer_cast(op->returnType()); diff --git a/cpp/src/slice2matlab/Main.cpp b/cpp/src/slice2matlab/Main.cpp index 92062b25cd9..ea21a2c9776 100644 --- a/cpp/src/slice2matlab/Main.cpp +++ b/cpp/src/slice2matlab/Main.cpp @@ -1713,7 +1713,6 @@ CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p) const string scoped = p->scoped(); const string abs = getAbsolute(p); InterfaceList bases = p->bases(); - const OperationList allOps = p->allOperations(); // // Generate proxy class. diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index 3606f64183c..77220939752 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -1391,8 +1391,6 @@ Gen::ObjectVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p) allOpNames.push_back("ice_ids"); allOpNames.push_back("ice_isA"); allOpNames.push_back("ice_ping"); - allOpNames.sort(); - allOpNames.unique(); out << sp; out << nl;