diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-11-16 17:26:22 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-11-16 17:26:22 -0500 |
commit | b3641516fb858dc003eb47095f8ae25fd352b4e0 (patch) | |
tree | 6640dfb1ed1c0d4fad3fc894fabee19225a7140f /libdimension/sphere.c | |
parent | 78dca8153f802f271b4f2aeca33d967a075e485e (diff) | |
download | dimension-b3641516fb858dc003eb47095f8ae25fd352b4e0.tar.xz |
Add some branch instrumentation from gcov profile.
Diffstat (limited to 'libdimension/sphere.c')
-rw-r--r-- | libdimension/sphere.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdimension/sphere.c b/libdimension/sphere.c index a3f0c90..96bc617 100644 --- a/libdimension/sphere.c +++ b/libdimension/sphere.c @@ -23,7 +23,7 @@ * Spheres. */ -#include "dimension.h" +#include "dimension-internal.h" /** Sphere intersection callback. */ static bool @@ -41,7 +41,8 @@ dmnsn_sphere_intersection_fn(const dmnsn_object *sphere, dmnsn_line l, return false; } else { double t = x[0]; - if (n == 2) + /* Optimize for the case where we're outside the sphere */ + if (dmnsn_likely(n == 2)) t = dmnsn_min(t, x[1]); intersection->t = t; |