Salome HOME
[EDF29093] : Quick fix resorbed
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfReal_i.cxx
index f918b8e6d30ec3b27a601b057a310cbe9dc49354..e07ed0b87282126ba570a02a82dce55eca7e50af 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -32,11 +32,9 @@ void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other
 {
   SALOMEDS::Locker lock; 
   CheckLocked();
-  std::vector<double> CasCadeSeq;
-  for (int i = 0; i < other.length(); i++) {
-    CasCadeSeq.push_back(other[i]);
-  }
-  dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Assign(CasCadeSeq);
+  std::vector<double> aSeq;
+  for(int i = 0, len = other.length(); i<len; i++) aSeq.push_back(other[i]);
+  dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Assign(aSeq);
 }
  
 SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
@@ -44,9 +42,9 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence()
   SALOMEDS::Locker lock; 
   SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
   const std::vector<double>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Array();
-  int len = CasCadeSeq.size();
+  size_t len = CasCadeSeq.size();
   CorbaSeq->length(len);
-  for (int i = 0; i < len; i++) {
+  for (size_t i = 0; i < len; i++) {
     CorbaSeq[i] = CasCadeSeq[i];
   }
   return CorbaSeq._retn();