From a28a7cd44a690b0eef511d82015ed14af819cb90 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 23 Mar 2021 17:11:26 +0100 Subject: [PATCH] Return directly --- .../include/CGAL/Kernel/function_objects.h | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 4b06db737af..b72ba5eb03b 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -49,26 +49,24 @@ namespace CommonKernelFunctors { int operator()(const Vector_3& vec) const { - int dir = -1; if(certainly_not(is_zero(vec.x()))){ - dir = 0; + return 0; } else if(certainly_not(is_zero(vec.y()))){ - dir = 1; + return 1; }else if(certainly_not(is_zero(vec.y()))){ - dir = 2; + return 2; } - if(dir == -1){ - if(! is_zero(vec.x())){ - return 0; - } else if(! is_zero(vec.y())){ - return 1; - } else if(! is_zero(vec.z())){ - return 2; - } + if(! is_zero(vec.x())){ + return 0; + } else if(! is_zero(vec.y())){ + return 1; + } else if(! is_zero(vec.z())){ + return 2; } - return dir; - } + + return -1; + } };