From a92605456b90d64c160f3d13a366154fa4c6c2f4 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 2 Feb 2016 16:59:10 +0100 Subject: [PATCH] Adrien does not like my DataArrayInt::begin and DataArrayInt::end method ... :( Ouiiinnnn --- src/MEDCoupling/MEDCouplingMemArray.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 99c1ad89a..3df9fb6c6 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -7831,12 +7831,8 @@ bool DataArrayInt::hasUniqueValues() const checkAllocated(); if(getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception("DataArrayInt::hasOnlyUniqueValues: must be applied on DataArrayInt with only one component, you can call 'rearrange' method before !"); - std::set s; // in C++11, should use unordered_set (O(1) complexity) - int nbOfTuples=getNumberOfTuples(); - const int *w=getConstPointer(); - const int *end2=w+nbOfTuples; - for(;w!=end2;w++) - s.insert(*w); + int nbOfTuples(getNumberOfTuples()); + std::set s(begin(),end()); // in C++11, should use unordered_set (O(1) complexity) if (s.size() != nbOfTuples) return false; return true; -- 2.39.2