From: Anthony Geay Date: Tue, 2 Feb 2016 15:59:10 +0000 (+0100) Subject: Adrien does not like my DataArrayInt::begin and DataArrayInt::end method ... :( Ouiiinnnn X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a92605456b90d64c160f3d13a366154fa4c6c2f4;p=tools%2Fmedcoupling.git Adrien does not like my DataArrayInt::begin and DataArrayInt::end method ... :( Ouiiinnnn --- 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;