Skip to content

Commit 973ec51

Browse files
committed
A slightly cleaner way to express the logic here
1 parent 9d125ea commit 973ec51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/swift/Demangling/TypeDecoder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,16 +693,16 @@ class TypeDecoder {
693693

694694
// If the tuple element is labeled, add its label to 'labels'.
695695
unsigned typeChildIndex = 0;
696-
if (element->getChild(0)->getKind() == NodeKind::VariadicMarker) {
697-
return BuiltType(); // Reject a variadic tuple mangling
696+
if (element->getChild(typeChildIndex)->getKind() == NodeKind::VariadicMarker) {
697+
return BuiltType();
698698
}
699-
if (element->getChild(0)->getKind() == NodeKind::TupleElementName) {
699+
if (element->getChild(typeChildIndex)->getKind() == NodeKind::TupleElementName) {
700700
// Add spaces to terminate all the previous labels if this
701701
// is the first we've seen.
702702
if (labels.empty()) labels.append(elements.size(), ' ');
703703

704704
// Add the label and its terminator.
705-
labels += element->getChild(0)->getText();
705+
labels += element->getChild(typeChildIndex)->getText();
706706
labels += ' ';
707707
typeChildIndex++;
708708

0 commit comments

Comments
 (0)