mirror of
https://github.com/minetest/minetest.git
synced 2024-07-02 14:10:33 +02:00
Eliminate risk of unwanted wraparound
This commit is contained in:
parent
8954059561
commit
d33da30fed
@ -353,10 +353,11 @@ class KdTree {
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
void rangeQuery(Idx root, uint8_t split,
|
||||
// Note: root is of type std::size_t to avoid issues with wraparound
|
||||
void rangeQuery(std::size_t root, uint8_t split,
|
||||
const Point &min, const Point &max,
|
||||
const F &cb) const {
|
||||
if (root >= cap()) // TODO what if we overflow earlier?
|
||||
if (root >= cap())
|
||||
return;
|
||||
const auto ptid = tree[root];
|
||||
const auto coord = items.points.begin(split)[ptid];
|
||||
|
Loading…
Reference in New Issue
Block a user