Skip to content

Commit 875b881

Browse files
committed
[clang-format][NFC] Remove redundant parentheses in the source code
Reformat the source code with RemoveParentheses set to ReturnStatement.
1 parent b10899d commit 875b881

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

clang/lib/Format/ContinuationIndenter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline,
617617
assert(!State.Stack.empty());
618618
State.NoContinuation = false;
619619

620-
if ((Current.is(TT_ImplicitStringLiteral) &&
621-
(!Previous.Tok.getIdentifierInfo() ||
622-
Previous.Tok.getIdentifierInfo()->getPPKeywordID() ==
623-
tok::pp_not_keyword))) {
620+
if (Current.is(TT_ImplicitStringLiteral) &&
621+
(!Previous.Tok.getIdentifierInfo() ||
622+
Previous.Tok.getIdentifierInfo()->getPPKeywordID() ==
623+
tok::pp_not_keyword)) {
624624
unsigned EndColumn =
625625
SourceMgr.getSpellingColumnNumber(Current.WhitespaceRange.getEnd());
626626
if (Current.LastNewlineOffset != 0) {

clang/lib/Format/DefinitionBlockSeparator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ void DefinitionBlockSeparator::separateBlocks(
5252
for (const FormatToken *CurrentToken = Line->First; CurrentToken;
5353
CurrentToken = CurrentToken->Next) {
5454
if (BracketLevel == 0) {
55-
if ((CurrentToken->isOneOf(tok::kw_class, tok::kw_struct,
56-
tok::kw_union) ||
57-
(Style.isJavaScript() &&
58-
CurrentToken->is(ExtraKeywords.kw_function)))) {
55+
if (CurrentToken->isOneOf(tok::kw_class, tok::kw_struct,
56+
tok::kw_union) ||
57+
(Style.isJavaScript() &&
58+
CurrentToken->is(ExtraKeywords.kw_function))) {
5959
return true;
6060
}
6161
if (!ExcludeEnum && CurrentToken->is(tok::kw_enum))
@@ -164,7 +164,7 @@ void DefinitionBlockSeparator::separateBlocks(
164164
}
165165
}
166166

167-
if ((Style.isCSharp() && OperateLine->First->is(TT_AttributeSquare)))
167+
if (Style.isCSharp() && OperateLine->First->is(TT_AttributeSquare))
168168
return true;
169169
return false;
170170
};

clang/lib/Format/QualifierAlignmentFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ bool LeftRightQualifierAlignmentFixer::isPossibleMacro(const FormatToken *Tok) {
618618
return false;
619619
if (Tok->TokenText.upper() == Tok->TokenText.str()) {
620620
// T,K,U,V likely could be template arguments
621-
return (Tok->TokenText.size() != 1);
621+
return Tok->TokenText.size() != 1;
622622
}
623623
return false;
624624
}

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,8 +2955,8 @@ class ExpressionParser {
29552955
Tok = Next;
29562956
if (Tok)
29572957
Tok = Tok->getNextNonComment();
2958-
} else if ((Keywords.isVerilogQualifier(*Tok) ||
2959-
Keywords.isVerilogIdentifier(*Tok))) {
2958+
} else if (Keywords.isVerilogQualifier(*Tok) ||
2959+
Keywords.isVerilogIdentifier(*Tok)) {
29602960
First = Tok;
29612961
Tok = Next;
29622962
// The name may have dots like `interface_foo.modport_foo`.

clang/lib/Format/UnwrappedLineFormatter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class LevelIndentTracker {
116116
return true;
117117
}
118118
// Handle Qt signals.
119-
else if ((RootToken.isOneOf(Keywords.kw_signals, Keywords.kw_qsignals) &&
120-
RootToken.Next && RootToken.Next->is(tok::colon))) {
119+
else if (RootToken.isOneOf(Keywords.kw_signals, Keywords.kw_qsignals) &&
120+
RootToken.Next && RootToken.Next->is(tok::colon)) {
121121
return true;
122122
} else if (RootToken.Next &&
123123
RootToken.Next->isOneOf(Keywords.kw_slots,

0 commit comments

Comments
 (0)