From 60ae50e01646887e9667703913f76f18b6ca6c2a Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:36:56 +0000 Subject: [PATCH] Codechange: Make kdtree member functions const for const-correctness (#13099) --- src/core/kdtree.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/kdtree.hpp b/src/core/kdtree.hpp index 5dc3a1263d..9a5eeaab5e 100644 --- a/src/core/kdtree.hpp +++ b/src/core/kdtree.hpp @@ -308,7 +308,7 @@ class Kdtree { } /** Check if the entire tree is in need of rebuilding */ - bool IsUnbalanced() + bool IsUnbalanced() const { size_t count = this->Count(); if (count < 8) return false; @@ -316,7 +316,7 @@ class Kdtree { } /** Verify that the invariant is true for a sub-tree, assert if not */ - void CheckInvariant(size_t node_idx, int level, CoordT min_x, CoordT max_x, CoordT min_y, CoordT max_y) + void CheckInvariant(size_t node_idx, int level, CoordT min_x, CoordT max_x, CoordT min_y, CoordT max_y) const { if (node_idx == INVALID_NODE) return; @@ -341,7 +341,7 @@ class Kdtree { } /** Verify the invariant for the entire tree, does nothing unless KDTREE_DEBUG is defined */ - void CheckInvariant() + void CheckInvariant() const { #ifdef KDTREE_DEBUG CheckInvariant(this->root, 0, std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::min(), std::numeric_limits::max()); -- 2.11.4.GIT