]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Adrien does not like my DataArrayInt::begin and DataArrayInt::end method ... :( Ouiiinnnn abn/mumesh_check
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 2 Feb 2016 15:59:10 +0000 (16:59 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 2 Feb 2016 15:59:10 +0000 (16:59 +0100)
src/MEDCoupling/MEDCouplingMemArray.cxx

index 99c1ad89a1a219323a7f51a0fc02729bb60627e9..3df9fb6c6bba1e96150cdc94298cad3eb9be8b70 100644 (file)
@@ -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<int> 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<int> s(begin(),end());  // in C++11, should use unordered_set (O(1) complexity)
   if (s.size() != nbOfTuples)
     return false;
   return true;