Skip to content

Commit 62f8d73

Browse files
committed
Address comments
- fix includes - avoid redundant conditional - fix stale comment after rename.
1 parent aaed271 commit 62f8d73

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/lib/Support/Mustache.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
//===----------------------------------------------------------------------===//
88
#include "llvm/Support/Mustache.h"
99
#include "llvm/ADT/SmallVector.h"
10-
#include "llvm/IR/Value.h"
11-
#include "llvm/Support/Error.h"
1210
#include "llvm/Support/raw_ostream.h"
1311
#include <sstream>
1412

@@ -610,14 +608,14 @@ void ASTNode::render(const json::Value &CurrentCtx, raw_ostream &OS) {
610608
auto SectionLambda = SectionLambdas.find(AccessorValue[0]);
611609
bool IsLambda = SectionLambda != SectionLambdas.end();
612610

613-
if (isContextFalsey(ContextPtr) && !IsLambda)
614-
return;
615-
616611
if (IsLambda) {
617612
renderSectionLambdas(CurrentCtx, OS, SectionLambda->getValue());
618613
return;
619614
}
620615

616+
if (isContextFalsey(ContextPtr))
617+
return;
618+
621619
if (const json::Array *Arr = ContextPtr->getAsArray()) {
622620
for (const json::Value &V : *Arr)
623621
renderChild(V, OS);
@@ -629,8 +627,8 @@ void ASTNode::render(const json::Value &CurrentCtx, raw_ostream &OS) {
629627
case InvertSection: {
630628
bool IsLambda = SectionLambdas.contains(AccessorValue[0]);
631629
if (isContextFalsey(ContextPtr) && !IsLambda) {
632-
// The context for the children remains UNCHANGED from the parent's.
633-
// We pass 'Data', which is this node's original incoming context.
630+
// The context for the children remains unchanged from the parent's, so
631+
// we pass this node's original incoming context.
634632
renderChild(CurrentCtx, OS);
635633
}
636634
return;

0 commit comments

Comments
 (0)