r223930 - clang-format: Remove a few else after return statements.
Daniel Jasper
djasper at google.com
Wed Dec 10 09:24:35 PST 2014
Author: djasper
Date: Wed Dec 10 11:24:34 2014
New Revision: 223930
URL: http://llvm.org/viewvc/llvm-project?rev=223930&view=rev
Log:
clang-format: Remove a few else after return statements.
They are against the LLVM coding conventions. No functional changes
intended.
Modified:
cfe/trunk/lib/Format/ContinuationIndenter.cpp
Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/ContinuationIndenter.cpp?rev=223930&r1=223929&r2=223930&view=diff
==============================================================================
--- cfe/trunk/lib/Format/ContinuationIndenter.cpp (original)
+++ cfe/trunk/lib/Format/ContinuationIndenter.cpp Wed Dec 10 11:24:34 2014
@@ -520,8 +520,7 @@ unsigned ContinuationIndenter::getNewLin
(Current.MatchingParen &&
Current.MatchingParen->BlockKind == BK_BracedInit))
return State.Stack[State.Stack.size() - 2].LastSpace;
- else
- return State.FirstIndent;
+ return State.FirstIndent;
}
if (Current.is(tok::identifier) && Current.Next &&
Current.Next->is(TT_DictLiteral))
@@ -532,11 +531,9 @@ unsigned ContinuationIndenter::getNewLin
State.Stack.back().FirstLessLess != 0)
return State.Stack.back().FirstLessLess;
if (NextNonComment->isMemberAccess()) {
- if (State.Stack.back().CallContinuation == 0) {
+ if (State.Stack.back().CallContinuation == 0)
return ContinuationIndent;
- } else {
- return State.Stack.back().CallContinuation;
- }
+ return State.Stack.back().CallContinuation;
}
if (State.Stack.back().QuestionColumn != 0 &&
((NextNonComment->is(tok::colon) &&
@@ -554,26 +551,22 @@ unsigned ContinuationIndenter::getNewLin
return std::max(State.Stack.back().LastSpace, State.Stack.back().Indent);
if (NextNonComment->is(TT_SelectorName)) {
if (!State.Stack.back().ObjCSelectorNameFound) {
- if (NextNonComment->LongestObjCSelectorName == 0) {
+ if (NextNonComment->LongestObjCSelectorName == 0)
return State.Stack.back().Indent;
- } else {
- return State.Stack.back().Indent +
- NextNonComment->LongestObjCSelectorName -
- NextNonComment->ColumnWidth;
- }
- } else if (!State.Stack.back().AlignColons) {
+ return State.Stack.back().Indent +
+ NextNonComment->LongestObjCSelectorName -
+ NextNonComment->ColumnWidth;
+ }
+ if (!State.Stack.back().AlignColons)
return State.Stack.back().Indent;
- } else if (State.Stack.back().ColonPos > NextNonComment->ColumnWidth) {
+ if (State.Stack.back().ColonPos > NextNonComment->ColumnWidth)
return State.Stack.back().ColonPos - NextNonComment->ColumnWidth;
- } else {
- return State.Stack.back().Indent;
- }
+ return State.Stack.back().Indent;
}
if (NextNonComment->is(TT_ArraySubscriptLSquare)) {
if (State.Stack.back().StartOfArraySubscripts != 0)
return State.Stack.back().StartOfArraySubscripts;
- else
- return ContinuationIndent;
+ return ContinuationIndent;
}
if (NextNonComment->is(TT_StartOfName) ||
Previous.isOneOf(tok::coloncolon, tok::equal)) {
More information about the cfe-commits
mailing list