[PATCH] D93938: [clang-format] Fixed AfterEnum handling
MyDeveloperDay via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 22 08:22:59 PDT 2021
MyDeveloperDay added a comment.
>> Since you use `== ' '` twice, `remainingLineCharCount` will count only consecutive spaces, right?
>> But you want to count other characters, no?
>> So, IIUC, the condition you want is `rF[wI] != '\n' && !(rF[wI] == ' ' && rF[wI - 1] == ' ')` (mind the negation). It will count characters other than a newline and it will only count a series of consecutive spaces as one char. WDYT?
That whole while loop leaves me feeling cold, it feels like a bug waiting to happen, frankly I don't understand why its necessary. It would be better to move the loop into a function and properly unit test it if there is really no other way
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93938/new/
https://reviews.llvm.org/D93938
More information about the cfe-commits
mailing list