Skip to content

Commit 68c99bb

Browse files
committed
Invert logic and use for all member accesses if less than 35
1 parent c00f9d1 commit 68c99bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4313,9 +4313,10 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
43134313
//
43144314
// aaaaaaa
43154315
// .aaaaaaaaa.bbbbbbbb(cccccccc);
4316-
return !Right.NextOperator || !Right.NextOperator->Previous->closesScope()
4317-
? Style.PenaltyBreakBeforeMemberAccess
4318-
: 35;
4316+
const auto Penalty = Style.PenaltyBreakBeforeMemberAccess;
4317+
return Right.NextOperator && Right.NextOperator->Previous->closesScope()
4318+
? std::min(Penalty, 35u)
4319+
: Penalty;
43194320
}
43204321

43214322
if (Right.is(TT_TrailingAnnotation) &&

0 commit comments

Comments
 (0)