diff options
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdtree.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c index 20e30ce669c..4f12bd0a93f 100644 --- a/source/blender/blenlib/intern/BLI_kdtree.c +++ b/source/blender/blenlib/intern/BLI_kdtree.c @@ -112,15 +112,10 @@ static uint kdtree_balance(KDTreeNode *nodes, uint totnode, uint axis, const uin float co; uint left, right, median, i, j; - if (totnode <= 0) { + if (totnode <= 0) return KD_NODE_UNSET; - } - else if (totnode == 1) { - node = nodes + ofs; - node->left = KD_NODE_UNSET; - node->right = KD_NODE_UNSET; + else if (totnode == 1) return 0 + ofs; - } /* quicksort style sorting around median */ left = 0; |