Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Jan 29, 2024
1 parent 4a00c66 commit 2a7de92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ivoc/ivocvect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/unit_tests/iovec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TEST_CASE("Test nrn_mlh_gsort output", "[nrn_gsort]") {
std::vector<int> indices{2, 1, 1};
std::vector<int> 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]);
Expand Down

0 comments on commit 2a7de92

Please sign in to comment.