================
@@ -251,10 +251,15 @@ class LineJoiner {
                 : Limit - TheLine->Last->TotalLength;
 
     if (TheLine->Last->is(TT_FunctionLBrace) &&
-        TheLine->First == TheLine->Last &&
-        !Style.BraceWrapping.SplitEmptyFunction &&
-        NextLine.First->is(tok::r_brace)) {
-      return tryMergeSimpleBlock(I, E, Limit);
+        TheLine->First == TheLine->Last) {
+      const bool EmptyFunctionBody = NextLine.First->is(tok::r_brace);
+      const bool ShortFunctionBody =
+          !EmptyFunctionBody && I + 2 != E && I[2]->First->is(tok::r_brace);
+      if ((EmptyFunctionBody && !Style.BraceWrapping.SplitEmptyFunction) ||
+          (ShortFunctionBody &&
----------------
owenca wrote:

```suggestion
          (!EmptyFunctionBody &&
```
No need for `ShortFunctionBody`.

https://github.com/llvm/llvm-project/pull/151428
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to