Skip to content

Commit

Permalink
Removed sorting of operation name lists (except in C++).
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere committed Jan 7, 2025
1 parent bcf95eb commit 9ade3bd
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 27 deletions.
1 change: 0 additions & 1 deletion cpp/src/Slice/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/ice2slice/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
31 changes: 13 additions & 18 deletions cpp/src/slice2cs/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> 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<string> params, args;
string ns = getNamespace(p);
string name = getDispatchParams(op, retS, params, args, ns);
_out << sp << nl << "public abstract " << retS << " " << name << spar << params << epar << ';';
}
}

Expand Down
2 changes: 0 additions & 2 deletions cpp/src/slice2java/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion cpp/src/slice2js/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Contained>(op->returnType());
Expand Down
1 change: 0 additions & 1 deletion cpp/src/slice2matlab/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/slice2swift/Gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9ade3bd

Please sign in to comment.