Commit 268ed99a authored by Mark Olesen's avatar Mark Olesen
Browse files

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>&)
parent 2c815e5b
......@@ -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)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment