Skip to content

Commit 1dbe275

Browse files
committed
fix false positive warning with gcc-14.2.1
1 parent f9fd41e commit 1dbe275

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/operators/non_dominated_sorter/rank_intersect.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ namespace {
4040
{
4141
auto const n = static_cast<int>(std::ssize(pop));
4242
auto const nb { static_cast<int>(n / DIGITS) + static_cast<int>(n % DIGITS != 0) };
43-
std::size_t const ub = DIGITS * nb - n;
43+
ENSURE(nb > 0);
44+
std::size_t const ub = (DIGITS * nb) - n;
4445

4546
std::vector<Item> items(n);
4647
for (auto i = 0; i < n; ++i) {
47-
items[i] = { i, pop[i][1] };
48+
items[i] = { .Index=i, .Value=pop[i][1] };
4849
}
4950
Sorter(items);
5051

0 commit comments

Comments
 (0)