================
@@ -1084,11 +1088,34 @@ bool IdentifierNamingCheck::isParamInMainLikeFunction(
   return Matcher.match(FDecl->getName());
 }
 
+static void trimPrefixesAndSuffixes(
+    StringRef &Mid,
+    ArrayRef<std::optional<IdentifierNamingCheck::NamingStyle>> NamingStyles,
+    bool TrimPrefixes, bool TrimSuffixes) {
+  bool LoopWhileToRemove = true;
+  while (LoopWhileToRemove) {
+    LoopWhileToRemove = false;
+    for (unsigned I = 0; I < SK_Count; ++I) {
+      if (const std::optional<IdentifierNamingCheck::NamingStyle> &OtherStyle =
+              NamingStyles[I]) {
+        while (TrimPrefixes && !OtherStyle->Prefix.empty() &&
----------------
vbvictor wrote:

Can be a range-based for loop:
```cpp
for (const auto &OtherStyle : NamingStyles) {
  if (OtherStyle) {
```

https://github.com/llvm/llvm-project/pull/181502
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to