From 49034b8eb1e1dc055b5cb5319948c923c78d63db Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Fri, 13 Dec 2024 13:50:50 +1100 Subject: Feature [feature-requests:#1538]. Reduce range checks in PartitionFromPosition to improve performance. --- src/Partitioning.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Partitioning.h b/src/Partitioning.h index 17bc1998e..db2e63c11 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -182,7 +182,7 @@ public: T upper = Partitions(); do { const T middle = (upper + lower + 1) / 2; // Round high - T posMiddle = body.ValueAt(middle); + T posMiddle = body[middle]; if (middle > stepPartition) posMiddle += stepLength; if (pos < posMiddle) { -- cgit v1.2.3