[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 29 18:16:46 PST 2024


================
@@ -916,6 +983,21 @@ class LineJoiner {
     return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit;
   }
 
+  bool nextNLinesFitInto(SmallVectorImpl<AnnotatedLine *>::const_iterator I,
+                         SmallVectorImpl<AnnotatedLine *>::const_iterator E,
+                         unsigned Limit) {
+    unsigned JoinedLength = 0;
+    for (auto J = I + 1; J != E; ++J) {
----------------
owenca wrote:

```suggestion
    for (const auto *J = I + 1; J != E; ++J) {
```

https://github.com/llvm/llvm-project/pull/105597


More information about the cfe-commits mailing list