]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Cube.hs
Remove all "otherwise -> error" cases for performance reasons.
[spline3.git] / src / Cube.hs
index 3c82f67e285f611ba64a11092d61c86cc890724a..9f931431b93bafb4ca6e0a13c0940bc036a3e01a 100644 (file)
@@ -506,9 +506,6 @@ tetrahedron cube 23 =
                        $ fv cube
       vol = tetrahedra_volume cube
 
--- Feels dirty, but whatever.
-tetrahedron _ _ = error "asked for a nonexistent tetrahedron"
-
 
 -- Only used in tests, so we don't need the added speed
 -- of Data.Vector.
@@ -620,6 +617,7 @@ in_left_half cube (Point _ y _) =
 --   This can throw an exception, but the use of 'head' might
 --   save us some unnecessary computations.
 --
+{-# INLINE find_containing_tetrahedron #-}
 find_containing_tetrahedron :: Cube -> Point -> Tetrahedron
 find_containing_tetrahedron cube p =
   candidates `V.unsafeIndex` (fromJust lucky_idx)