From ccff0db36df958812736e3cc977df970ad56714f Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Wed, 9 Apr 2008 14:25:17 +0000 Subject: [PATCH] Use new style with make_array(), more compact and efficient --- Cartesian_kernel/include/CGAL/Cartesian/Point_2.h | 8 ++------ Cartesian_kernel/include/CGAL/Cartesian/Point_3.h | 8 ++------ Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h | 8 ++------ Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h | 8 ++------ 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h index ca175779c9b..3279285cecc 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h @@ -60,12 +60,8 @@ public: : base(CGALi::make_array(x, y)) {} PointC2(const FT &hx, const FT &hy, const FT &hw) - { - if (hw != FT(1)) - base = CGALi::make_array(hx/hw, hy/hw); - else - base = CGALi::make_array(hx, hy); - } + : base( hw != FT(1) ? CGALi::make_array(hx/hw, hy/hw) + : CGALi::make_array(hx, hy) ) {} const FT& x() const { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h index 6964650ea0b..37cf361b7a0 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Point_3.h @@ -57,12 +57,8 @@ public: : base(CGALi::make_array(x, y, z)) {} PointC3(const FT &x, const FT &y, const FT &z, const FT &w) - { - if (w != FT(1)) - base = CGALi::make_array(x/w, y/w, z/w); - else - base = CGALi::make_array(x, y, z); - } + : base( w != FT(1) ? CGALi::make_array(x/w, y/w, z/w) + : CGALi::make_array(x, y, z) ) {} /* bool operator==(const PointC3 &p) const diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h index 71c1317c44f..ab8db68c2bd 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h @@ -56,12 +56,8 @@ public: : base(CGALi::make_array(x, y)) {} VectorC2(const FT &hx, const FT &hy, const FT &hw) - { - if (hw != FT(1)) - base = CGALi::make_array(hx/hw, hy/hw); - else - base = CGALi::make_array(hx, hy); - } + : base( hw != FT(1) ? CGALi::make_array(hx/hw, hy/hw) + : CGALi::make_array(hx, hy) ) {} const FT & x() const { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index 1a8873f599f..1b5cc2ba48e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -70,12 +70,8 @@ public: : base(CGALi::make_array(x, y, z)) {} VectorC3(const FT &x, const FT &y, const FT &z, const FT &w) - { - if (w != FT(1)) - base = CGALi::make_array(x/w, y/w, z/w); - else - base = CGALi::make_array(x, y, z); - } + : base( w != FT(1) ? CGALi::make_array(x/w, y/w, z/w) + : CGALi::make_array(x, y, z) ) {} const FT & x() const {