Fix size bug in PackedList operator=, spotted by Mattijs.

- the size_ was not being adjusted in two assignment operators:
      PackedList<nBits>::operator=(const PackedList<nBits>&)
      PackedList<nBits>::operator=(const UList<label>&)
This commit is contained in:
Mark Olesen
2009-12-15 13:01:48 +01:00
parent 2c815e5b84
commit 268ed99a7e

View File

@ -267,8 +267,8 @@ Foam::Ostream& Foam::PackedList<nBits>::print(Ostream& os) const
template<unsigned nBits>
void Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst)
{
setCapacity(lst.size());
StorageList::operator=(lst);
size_ = lst.size();
}
@ -276,6 +276,7 @@ template<unsigned nBits>
void Foam::PackedList<nBits>::operator=(const UList<label>& lst)
{
setCapacity(lst.size());
size_ = lst.size();
forAll(lst, i)
{