From 48bf4c3f52d274a9ee862880927cadbf6e75c74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 10 Feb 2020 18:18:26 +0100 Subject: [PATCH] Fix warning about copying return value despite being passed by name --- .../include/CGAL/Cartesian/ConicCPA2.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/ConicCPA2.h b/Cartesian_kernel/include/CGAL/Cartesian/ConicCPA2.h index a5b1a17e02d..0461b383ba8 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/ConicCPA2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/ConicCPA2.h @@ -312,15 +312,12 @@ class ConicCPA2 PT center () const { CGAL_kernel_precondition (type != PARABOLA); - // PT p; - // replaced previous line by following hack (no idea - // why original version doesn't work) - typename DA::Point p; - FT two = FT(2); - FT div = -det(); - dao.set( p, (two*s()*u() - t()*v()) / div, - (two*r()*v() - t()*u()) / div); - return p; + + const FT two = FT(2); + const FT div = -det(); + + return PT((two*s()*u() - t()*v()) / div, + (two*r()*v() - t()*u()) / div); } Conic_type conic_type () const