diff --git a/Data_classification/include/CGAL/Point_set_classification.h b/Data_classification/include/CGAL/Point_set_classification.h index 5311db5c482..e5f47a76dc8 100644 --- a/Data_classification/include/CGAL/Point_set_classification.h +++ b/Data_classification/include/CGAL/Point_set_classification.h @@ -391,13 +391,11 @@ public: neighborhood.k_neighbors (m_input[s], 12, std::back_inserter (neighbors)); for (std::size_t i = 0; i < neighbors.size(); ++ i) - { - edges.push_back (std::make_pair (s, neighbors[i])); - if (s != neighbors[i]) + if (s != neighbors[i]) + { + edges.push_back (std::make_pair (s, neighbors[i])); edge_weights.push_back (weight); - else - edge_weights.push_back (0.); - } + } std::size_t nb_class_best = 0; double val_class_best = (std::numeric_limits::max)();