From 2a7de92b48a27660329462da0b5302dbe1e8d537 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 29 Jan 2024 16:52:25 +0100 Subject: [PATCH] fix review --- src/ivoc/ivocvect.cpp | 2 +- test/unit_tests/iovec.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ivoc/ivocvect.cpp b/src/ivoc/ivocvect.cpp index b124e516fe..866fab6836 100644 --- a/src/ivoc/ivocvect.cpp +++ b/src/ivoc/ivocvect.cpp @@ -3877,7 +3877,7 @@ void Vector_reg() { } int nrn_mlh_gsort(double* vec, int* base_ptr, int total_elems, int (*cmp)(double, double)) { - std::sort(base_ptr, base_ptr + total_elems, [&](const int& a, const int& b) { + std::sort(base_ptr, base_ptr + total_elems, [&](int a, int b) { return cmp(vec[a], vec[b]) < 0; }); return 1; diff --git a/test/unit_tests/iovec.cpp b/test/unit_tests/iovec.cpp index 02e8558d2c..946ad7c7fa 100644 --- a/test/unit_tests/iovec.cpp +++ b/test/unit_tests/iovec.cpp @@ -35,7 +35,7 @@ TEST_CASE("Test nrn_mlh_gsort output", "[nrn_gsort]") { std::vector indices{2, 1, 1}; std::vector expected_result{1, 1, 2}; // as -2,5 < 5.1 - SECTION("Test sorting with repeted indices") { + SECTION("Test sorting with repeated indices") { nrn_mlh_gsort(input.data(), indices.data(), input.size(), cmpdfn); for (auto i = 0; i < input.size(); ++i) { REQUIRE(indices[i] == expected_result[i]);