Skip to content

Commit

Permalink
Fix swap
Browse files Browse the repository at this point in the history
  • Loading branch information
jolting committed Jun 23, 2019
1 parent 110cc94 commit 820d11b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/math/include/mrpt/math/CMatrixDynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ class vector_with_small_size_optimization {
m_v.swap(x.m_v);
}
else if (!m_is_small && x.m_is_small) {
m_a = x.m_a;
std::copy(x.m_a.begin(), x.m_a.begin() + x.m_size, m_a.begin());
x.m_v.swap(m_v);
}
else {
m_v.swap(x.m_v);
x.m_a = x.m_a;
std::copy(m_a.begin(), m_a.begin() + m_size, x.m_a.begin());
}
std::swap(m_size, x.m_size);
std::swap(m_is_small, x.m_is_small);
Expand Down

0 comments on commit 820d11b

Please sign in to comment.