Skip to content

Commit fe845fd

Browse files
committed
Use inline constexpr for PRIMES and MOD_PRIME arrays
1 parent 55c5b0a commit fe845fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/tsl/robin_growth_policy.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ namespace detail {
253253
#define TSL_RH_NB_PRIMES 23
254254
#endif
255255

256-
static constexpr const std::array<std::size_t, TSL_RH_NB_PRIMES> PRIMES = {{
256+
inline constexpr std::array<std::size_t, TSL_RH_NB_PRIMES> PRIMES = {{
257257
1u,
258258
5u,
259259
17u,
@@ -319,8 +319,7 @@ static constexpr std::size_t mod(std::size_t hash) {
319319
// MOD_PRIME[iprime](hash) returns hash % PRIMES[iprime]. This table allows for
320320
// faster modulo as the compiler can optimize the modulo code better with a
321321
// constant known at the compilation.
322-
static constexpr const std::array<std::size_t (*)(std::size_t),
323-
TSL_RH_NB_PRIMES>
322+
inline constexpr std::array<std::size_t (*)(std::size_t), TSL_RH_NB_PRIMES>
324323
MOD_PRIME = {{
325324
&mod<0>, &mod<1>, &mod<2>, &mod<3>, &mod<4>, &mod<5>,
326325
&mod<6>, &mod<7>, &mod<8>, &mod<9>, &mod<10>, &mod<11>,

0 commit comments

Comments
 (0)