Kaydet (Commit) b6e43aac authored tarafından Michael Stahl's avatar Michael Stahl

sw: RingContainer::merge(): assert that the Rings aren't already linked

The function would un-merge them in that case, which is just a little
bit surprising.

Change-Id: Ife1d572635b812d3ff5b9f93c1ddf1954e12aca5
üst f7db2461
......@@ -185,6 +185,10 @@ namespace sw
*/
void merge( RingContainer< value_type > aDestRing )
{
// first check that we aren't merged already, swapping would
// actually un-merge in this case!
assert(m_pStart->pPrev != aDestRing.m_pStart);
assert(m_pStart != aDestRing.m_pStart->pPrev);
std::swap(*(&m_pStart->pPrev->pNext), *(&aDestRing.m_pStart->pPrev->pNext));
std::swap(*(&m_pStart->pPrev), *(&aDestRing.m_pStart->pPrev));
}
......
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