summaryrefslogtreecommitdiffstats
path: root/libdimension/prtree.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-11-16 17:26:22 -0500
committerTavian Barnes <tavianator@gmail.com>2011-11-16 17:26:22 -0500
commitb3641516fb858dc003eb47095f8ae25fd352b4e0 (patch)
tree6640dfb1ed1c0d4fad3fc894fabee19225a7140f /libdimension/prtree.c
parent78dca8153f802f271b4f2aeca33d967a075e485e (diff)
downloaddimension-b3641516fb858dc003eb47095f8ae25fd352b4e0.tar.xz
Add some branch instrumentation from gcov profile.
Diffstat (limited to 'libdimension/prtree.c')
-rw-r--r--libdimension/prtree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdimension/prtree.c b/libdimension/prtree.c
index 33cb9a2..2451f6b 100644
--- a/libdimension/prtree.c
+++ b/libdimension/prtree.c
@@ -612,11 +612,11 @@ dmnsn_prtree_intersection(const dmnsn_prtree *tree, dmnsn_line ray,
/* Search the intersection cache */
dmnsn_intersection_cache *cache = dmnsn_get_intersection_cache(tree->id);
- if (reset) {
+ if (dmnsn_unlikely(reset)) {
cache->i = 0;
}
dmnsn_object *cached = NULL, *found = NULL;
- if (cache->i < DMNSN_PRTREE_CACHE_SIZE) {
+ if (dmnsn_likely(cache->i < DMNSN_PRTREE_CACHE_SIZE)) {
cached = cache->objects[cache->i];
}
if (cached && dmnsn_ray_box_intersection(optline, cached->bounding_box, t)) {
@@ -642,7 +642,7 @@ dmnsn_prtree_intersection(const dmnsn_prtree *tree, dmnsn_line ray,
}
/* Update the cache */
- if (cache->i < DMNSN_PRTREE_CACHE_SIZE) {
+ if (dmnsn_likely(cache->i < DMNSN_PRTREE_CACHE_SIZE)) {
cache->objects[cache->i] = found;
++cache->i;
}