From 1dfd16ea014127c4413c4114920e2d251d6a6652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 4 Apr 2022 09:59:42 +0200 Subject: [PATCH] use traits member --- .../include/CGAL/Hilbert_sort_middle_3.h | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h index 479cde7812d..85ffa7a270e 100644 --- a/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h +++ b/Spatial_sorting/include/CGAL/Hilbert_sort_middle_3.h @@ -154,26 +154,25 @@ public: template void operator() (RandomAccessIterator begin, RandomAccessIterator end) const { - K k; - double xmin=to_double(k.compute_x_3_object()(*begin)), - ymin=to_double(k.compute_y_3_object()(*begin)), - zmin=to_double(k.compute_z_3_object()(*begin)), + double xmin=to_double(_k.compute_x_3_object()(*begin)), + ymin=to_double(_k.compute_y_3_object()(*begin)), + zmin=to_double(_k.compute_z_3_object()(*begin)), xmax=xmin, ymax=ymin, zmax=zmin; for(RandomAccessIterator it=begin+1; it xmax) - xmax = to_double(k.compute_x_3_object()(*it)); - if ( to_double(k.compute_y_3_object()(*it)) > ymax) - ymax = to_double(k.compute_y_3_object()(*it)); - if ( to_double(k.compute_z_3_object()(*it)) > zmax) - zmax = to_double(k.compute_z_3_object()(*it)); + if ( to_double(_k.compute_x_3_object()(*it)) < xmin) + xmin = to_double(_k.compute_x_3_object()(*it)); + if ( to_double(_k.compute_y_3_object()(*it)) < ymin) + ymin = to_double(_k.compute_y_3_object()(*it)); + if ( to_double(_k.compute_z_3_object()(*it)) < zmin) + zmin = to_double(_k.compute_z_3_object()(*it)); + if ( to_double(_k.compute_x_3_object()(*it)) > xmax) + xmax = to_double(_k.compute_x_3_object()(*it)); + if ( to_double(_k.compute_y_3_object()(*it)) > ymax) + ymax = to_double(_k.compute_y_3_object()(*it)); + if ( to_double(_k.compute_z_3_object()(*it)) > zmax) + zmax = to_double(_k.compute_z_3_object()(*it)); } sort <0, false, false, false> (begin, end, xmin,ymin,zmin,xmax,ymax,zmax);