From adaa01c13e362ec2b21d287b042c82cc9299067d Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 19 Mar 2014 13:15:28 -0700 Subject: [PATCH] optimize isLeaf() to just check the child mask instead of counting children --- libraries/octree/src/OctreeElement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/octree/src/OctreeElement.h b/libraries/octree/src/OctreeElement.h index 1785307696..cbdad959be 100644 --- a/libraries/octree/src/OctreeElement.h +++ b/libraries/octree/src/OctreeElement.h @@ -126,7 +126,7 @@ public: float distanceSquareToPoint(const glm::vec3& point) const; // when you don't need the actual distance, use this. float distanceToPoint(const glm::vec3& point) const; - bool isLeaf() const { return getChildCount() == 0; } + bool isLeaf() const { return _childBitmask == 0; } int getChildCount() const { return numberOfOnes(_childBitmask); } void printDebugDetails(const char* label) const; bool isDirty() const { return _isDirty; }