Skip to content

Commit 66b2229

Browse files
committed
[lldb] Remove accidental code duplication (NFC)
This was most likely introduced while resolving a merge conflict and resulted in accidentally turning this into an exponential algorithm. rdar://148290475 (cherry picked from commit 39d1f7a)
1 parent 391ed42 commit 66b2229

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,29 +1275,9 @@ TypeSystemSwiftTypeRef::Canonicalize(swift::Demangle::Demangler &dem,
12751275
// Hit the safeguard limit.
12761276
return node;
12771277
}
1278-
default: {
1279-
llvm::SmallVector<NodePointer, 2> children;
1280-
bool changed = false;
1281-
for (NodePointer child : *node) {
1282-
NodePointer transformed = GetCanonicalNode(dem, child, flavor);
1283-
changed |= (child != transformed);
1284-
children.push_back(transformed);
1285-
}
1286-
if (changed) {
1287-
// Create a new node with the transformed children.
1288-
auto kind = node->getKind();
1289-
if (node->hasText())
1290-
node = dem.createNodeWithAllocatedText(kind, node->getText());
1291-
else if (node->hasIndex())
1292-
node = dem.createNode(kind, node->getIndex());
1293-
else
1294-
node = dem.createNode(kind);
1295-
for (NodePointer transformed_child : children)
1296-
node->addChild(transformed_child, dem);
1297-
}
1278+
default:
12981279
return node;
12991280
}
1300-
}
13011281
return node;
13021282
}
13031283

0 commit comments

Comments
 (0)