[libcxx-commits] [libcxx] [libc++] Fix calling push_heap on an empty range in the push_heap benchmark (PR #227076)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 01:36:10 PDT 2026


================
@@ -39,7 +39,7 @@ int main(int argc, char** argv) {
             while (st.KeepRunningBatch(BatchSize * size)) {
               for (std::size_t i = 0; i != BatchSize; ++i) {
                 benchmark::DoNotOptimize(c[i]);
-                for (size_t k = 0; k != c[i].size(); ++k)
+                for (size_t k = 1; k <= c[i].size(); ++k)
----------------
philnik777 wrote:

Why do we need `<=`?

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


More information about the libcxx-commits mailing list