From ff7bba8dad5d09f8b3e53a9a31a5f5fa50099b44 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 8 Sep 2022 09:52:42 -0500 Subject: 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 --- source/blender/blenlib/BLI_probing_strategies.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib') 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 + /** \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::max(); } }; -- cgit v1.2.3