aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2012-12-05 16:24:48 +0000
committerDaniel Jasper <djasper@google.com>2012-12-05 16:24:48 +0000
commitdfbb3197de8407a4209f328e4de1ae73bac70b8b (patch)
treef28bc579e9fe8618d0b24ea6be58e6bc263c0948 /lib/Format/Format.cpp
parent2e97cfc78743fcaa988e3c45f7af1002063f780c (diff)
Remove bad and useless enum to bool conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 030e35e38d..6494c3d389 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -509,11 +509,8 @@ public:
canBreakBetween(Line.Tokens[i - 1], Line.Tokens[i]);
if (Line.Tokens[i].Tok.is(tok::colon)) {
- if (Line.Tokens[0].Tok.is(tok::kw_case) || i == e - 1) {
- Annotation.SpaceRequiredBefore = false;
- } else {
- Annotation.SpaceRequiredBefore = TokenAnnotation::TT_ConditionalExpr;
- }
+ Annotation.SpaceRequiredBefore =
+ Line.Tokens[0].Tok.isNot(tok::kw_case) && i != e - 1;
} else if (Annotations[i - 1].Type == TokenAnnotation::TT_UnaryOperator) {
Annotation.SpaceRequiredBefore = false;
} else if (Annotation.Type == TokenAnnotation::TT_UnaryOperator) {