Salome HOME
small correction of doc
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingMemArray.txx
index 96160edb7719f5b8e4c1b264db47a291672c1828..bff8f089b993d10a161006dbc4b211f79211000d 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
 //
 // 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
@@ -133,8 +133,7 @@ namespace ParaMEDMEM
   template<class T>
   void MemArray<T>::pack() const
   {
-    if(_nb_of_elem>=0)
-      (const_cast<MemArray<T> * >(this))->reserve(_nb_of_elem);
+    (const_cast<MemArray<T> * >(this))->reserve(_nb_of_elem);
   }
 
   template<class T>
@@ -337,8 +336,6 @@ namespace ParaMEDMEM
   void MemArray<T>::alloc(std::size_t nbOfElements)
   {
     destroy();
-    if(nbOfElements<0)
-      throw INTERP_KERNEL::Exception("MemArray::alloc : request for negative length of data !");
     _nb_of_elem=nbOfElements;
     _nb_of_elem_alloc=nbOfElements;
     _pointer.setInternal((T*)malloc(_nb_of_elem_alloc*sizeof(T)));
@@ -382,8 +379,6 @@ namespace ParaMEDMEM
   template<class T>
   void MemArray<T>::reAlloc(std::size_t newNbOfElements)
   {
-    if(newNbOfElements<0)
-      throw INTERP_KERNEL::Exception("MemArray::reAlloc : request for negative length of data !");
     if(_nb_of_elem==newNbOfElements)
       return ;
     T *pointer=(T*)malloc(newNbOfElements*sizeof(T));