]> granicus.if.org Git - clang/commitdiff
Formatter: Remove a redundant CurrentLineType check.
authorNico Weber <nicolasweber@gmx.de>
Sat, 12 Jan 2013 07:00:16 +0000 (07:00 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 12 Jan 2013 07:00:16 +0000 (07:00 +0000)
The containing if checks for this already. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172306 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/Format.cpp
unittests/Format/FormatTest.cpp

index 0c486e0be3dd77a19a3e68a9cff6142cc37eb44a..89fbf61da0d75842ab0d8b1312ef7c69be3ae754 100644 (file)
@@ -1176,8 +1176,8 @@ private:
       if (Right.is(tok::identifier) && !Right.Children.empty() &&
           Right.Children[0].is(tok::colon) && Left.is(tok::identifier))
         return true;
-      if (CurrentLineType == LT_ObjCMethodDecl && Right.is(tok::identifier) &&
-          Left.is(tok::l_paren) && Left.Parent->is(tok::colon))
+      if (Right.is(tok::identifier) && Left.is(tok::l_paren) &&
+          Left.Parent->is(tok::colon))
         // Don't break this identifier as ':' or identifier
         // before it will break.
         return false;
index 90bdb67cffb78101bbbcf33ce4f5d8d8b8e5ccbd..84ce0c1e06d3b7e8fc7575e13dbacb779d5e9664 100644 (file)
@@ -1515,7 +1515,6 @@ TEST_F(FormatTest, FormatObjCMethodExpr) {
   verifyFormat("[self stuffWithInt:a ? (e ? f : g) : c];");
   verifyFormat("[cond ? obj1 : obj2 methodWithParam:param]");
   
-
   verifyFormat("arr[[self indexForFoo:a]];");
   verifyFormat("throw [self errorFor:a];");
   verifyFormat("@throw [self errorFor:a];");