From a9b349ad01177df47e65438d94a3ee2cf4772392 Mon Sep 17 00:00:00 2001 From: Mitsuru Kariya Date: Fri, 27 Sep 2013 12:33:22 +0900 Subject: [PATCH] [darkroom.objects.sphere] Reduce function call.(Remove function zweitens_2) --- sprout/darkroom/objects/sphere.hpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sprout/darkroom/objects/sphere.hpp b/sprout/darkroom/objects/sphere.hpp index b693bfd5..7796c7b4 100644 --- a/sprout/darkroom/objects/sphere.hpp +++ b/sprout/darkroom/objects/sphere.hpp @@ -66,26 +66,17 @@ namespace sprout { radius_type rad_; material_type mat_; private: - SPROUT_STATIC_CONSTEXPR zwo_type - zweitens_2(unit_type const& i1, unit_type const& i2, int hit_side, bool does_intersect) { - return zwo_type( - hit_side, - does_intersect, - hit_side < 0 ? i2 - : hit_side > 0 ? i1 - : -1 - ); - } SPROUT_STATIC_CONSTEXPR zwo_type zweitens_1(unit_type const& i1, unit_type const& i2) { - return zweitens_2( - i1, - i2, + return zwo_type( i2 > 0 ? i1 < 0 ? -1 : 1 : 0 , + i2 > 0, i2 > 0 + ? i1 < 0 ? i2 : i1 + : -1 ); } SPROUT_STATIC_CONSTEXPR zwo_type