Skip to content

Commit 29bba68

Browse files
committed
[llvm] fix failing mustache regression test
1 parent fd7c106 commit 29bba68

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/include/llvm/Support/Mustache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,16 @@ class ASTNode {
129129
InvertSection,
130130
};
131131

132-
ASTNode() : T(Type::Root), ParentContext(nullptr), LocalContext(nullptr){};
132+
ASTNode() : T(Type::Root), ParentContext(nullptr), LocalContext(nullptr) {};
133133

134134
ASTNode(StringRef Body, ASTNode *Parent)
135135
: T(Type::Text), Body(Body), Parent(Parent), ParentContext(nullptr),
136-
LocalContext(nullptr), Indentation(0){};
136+
LocalContext(nullptr), Indentation(0) {};
137137

138138
// Constructor for Section/InvertSection/Variable/UnescapeVariable
139139
ASTNode(Type T, Accessor Accessor, ASTNode *Parent)
140140
: T(T), Parent(Parent), Children({}), Accessor(Accessor),
141-
ParentContext(nullptr), LocalContext(nullptr), Indentation(0){};
141+
ParentContext(nullptr), LocalContext(nullptr), Indentation(0) {};
142142

143143
void addChild(ASTNode *Child) { Children.emplace_back(Child); };
144144

llvm/lib/Support/Mustache.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ SmallString<0> escapeString(StringRef Input,
1919

2020
SmallString<0> Output;
2121
for (char C : Input) {
22-
if (Escape.find(C) != Escape.end())
23-
Output += Escape[C];
22+
auto It = Escape.find(C);
23+
if (It != Escape.end())
24+
Output += It->getSecond();
2425
else
2526
Output += C;
2627
}

0 commit comments

Comments
 (0)