diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C index 5b99c3c3cd84622871e5e08f850e9b312f21cbe9..c22f774f9f126d303e876ce1682ede73e081abe0 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.C +++ b/src/OpenFOAM/containers/Lists/UList/UList.C @@ -81,22 +81,8 @@ void Foam::UList<T>::operator=(const T& t) template<class T> void Foam::UList<T>::swap(UList<T>& a) { - if (a.size_ != this->size_) - { - FatalErrorIn("UList<T>::swap(const UList<T>&)") - << "ULists have different sizes: " - << this->size_ << " " << a.size_ - << abort(FatalError); - } - - List_ACCESS(T, (*this), vp); - List_ACCESS(T, a, ap); - T tmp; - List_FOR_ALL((*this), i) - tmp = List_CELEM((*this), vp, i); - List_ELEM((*this), vp, i) = List_CELEM(a, ap, i); - List_ELEM(a, ap, i) = tmp; - List_END_FOR_ALL + Swap(size_, a.size_); + Swap(v_, a.v_); }