Skip to content

Commit aebd7ab

Browse files
committed
Foundation Classes - Optimize Exchange method in NCollection_Map to swap first and last pointers
1 parent 5be8ec3 commit aebd7ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NCollection/NCollection_Map.hxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ public:
185185
void Exchange (NCollection_Map& theOther)
186186
{
187187
this->exchangeMapsData (theOther);
188+
std::swap(myLast, theOther.myLast);
189+
std::swap(myFirst, theOther.myFirst);
188190
}
189191

190192
//! Assign.
@@ -217,7 +219,7 @@ public:
217219
{
218220
if (this == &theOther)
219221
return *this;
220-
exchangeMapsData(theOther);
222+
Exchange(theOther);
221223
return *this;
222224
}
223225

0 commit comments

Comments
 (0)