Skip to content

Commit

Permalink
Foundation Classes - Optimize Exchange method in NCollection_Map to s…
Browse files Browse the repository at this point in the history
…wap first and last pointers
  • Loading branch information
dpasukhi committed Dec 26, 2024
1 parent d12e566 commit dc6f4e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NCollection/NCollection_Map.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public:
void Exchange (NCollection_Map& theOther)
{
this->exchangeMapsData (theOther);
std::swap(myLast, theOther.myLast);
std::swap(myFirst, theOther.myFirst);
}

//! Assign.
Expand Down Expand Up @@ -217,7 +219,7 @@ public:
{
if (this == &theOther)
return *this;
exchangeMapsData(theOther);
Exchange(theOther);
return *this;
}

Expand Down

0 comments on commit dc6f4e3

Please sign in to comment.