[libc-commits] [libc] Fix build issues with libc mem* benchmarks (PR #115982)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Nov 13 08:22:17 PST 2024


================
@@ -185,11 +185,9 @@ ArrayRef<MemorySizeDistribution> getMemcmpSizeDistributions() {
 MemorySizeDistribution
 getDistributionOrDie(ArrayRef<MemorySizeDistribution> Distributions,
                      StringRef Name) {
-  size_t Index = 0;
   for (const auto &MSD : Distributions) {
     if (MSD.Name == Name)
       return MSD;
-    ++Index;
   }
----------------
nickdesaulniers wrote:

Feel free to remove the `{}` on the `for` loop now.
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

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


More information about the libc-commits mailing list