Skip to content

Commit f9cc17d

Browse files
that will teach me to not copy code from stackoverflow without checking it thoroughly
1 parent 5007a81 commit f9cc17d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/nbl/core/algorithm/radix_sort.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct KeyAdaptor
3434
};
3535

3636
template<typename T>
37-
constexpr uint8_t find_msb(const T& a_variable)
37+
constexpr int8_t find_msb(const T& a_variable)
3838
{
3939
static_assert(std::is_unsigned<T>::value, "Variable must be unsigned");
4040

@@ -44,9 +44,9 @@ constexpr uint8_t find_msb(const T& a_variable)
4444
for (uint8_t msb = number_of_bits - 1; msb >= 0; msb--)
4545
{
4646
if (variable_bitset[msb] == 1)
47-
return msb + 1;
47+
return msb;
4848
}
49-
return 0;
49+
return -1;
5050
}
5151

5252
template<size_t key_bit_count, typename histogram_t>

0 commit comments

Comments
 (0)