BLI_kdtree: use UNLIKELY
authorCampbell Barton <ideasman42@gmail.com>
Wed, 28 May 2014 16:37:16 +0000 (02:37 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jun 2014 14:47:11 +0000 (00:47 +1000)
source/blender/blenlib/intern/BLI_kdtree.c

index ed6e6e3ab92685b912cbd078745eb623d91ac1c0..082a54a57740a27bfaa9f86aaf9459719c1fba95 100644 (file)
@@ -207,7 +207,7 @@ int BLI_kdtree_find_nearest(
        BLI_assert(tree->is_balanced == true);
 #endif
 
-       if (!tree->root)
+       if (UNLIKELY(!tree->root))
                return -1;
 
        stack = defaultstack;
@@ -322,7 +322,7 @@ int BLI_kdtree_find_nearest_n__normal(
        BLI_assert(tree->is_balanced == true);
 #endif
 
-       if (!tree->root || n == 0)
+       if (UNLIKELY(!tree->root || n == 0))
                return 0;
 
        stack = defaultstack;
@@ -445,7 +445,7 @@ int BLI_kdtree_range_search__normal(
        BLI_assert(tree->is_balanced == true);
 #endif
 
-       if (!tree->root)
+       if (UNLIKELY(!tree->root))
                return 0;
 
        stack = defaultstack;