diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-08 17:52:42 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-08 17:52:42 +0300 |
commit | ff7bba8dad5d09f8b3e53a9a31a5f5fa50099b44 (patch) | |
tree | a568bb1e4561025f2db3c6c7ba60b605240a3905 /source/blender/blenlib/BLI_probing_strategies.hh | |
parent | 17f37b43f1f4aa2d2111a88e10dd0aaab659f203 (diff) |
Fix: Integer type in linear probing strategy
Probing strategies must iterate over every possible hash, but the linear
strategy only did 2^32 iterations, not 2^64. Updating this was missed
in 8cbbdedaf4dfec9e3. Also fix an unnecessary comma.
Differential Revision: https://developer.blender.org/D15913
Diffstat (limited to 'source/blender/blenlib/BLI_probing_strategies.hh')
-rw-r--r-- | source/blender/blenlib/BLI_probing_strategies.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_probing_strategies.hh b/source/blender/blenlib/BLI_probing_strategies.hh index c6152e4d03d..2c001270495 100644 --- a/source/blender/blenlib/BLI_probing_strategies.hh +++ b/source/blender/blenlib/BLI_probing_strategies.hh @@ -2,6 +2,8 @@ #pragma once +#include <numeric> + /** \file * \ingroup bli * @@ -20,7 +22,7 @@ * clustering issues. However, more linear steps can also make things slower when the initial hash * produces many collisions. * - * Every probing strategy has to guarantee, that every possible uint64_t is returned eventually. + * Every probing strategy has to guarantee that every possible uint64_t is returned eventually. * This is necessary for correctness. If this is not the case, empty slots might not be found. * * The SLOT_PROBING_BEGIN and SLOT_PROBING_END macros can be used to implement a loop that iterates @@ -69,7 +71,7 @@ class LinearProbingStrategy { int64_t linear_steps() const { - return UINT32_MAX; + return std::numeric_limits<int64_t>::max(); } }; |