mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-15 12:07:41 +08:00
0029064: Copying of empty NCollection map takes excessive memory
Avoid resizing of NCollection maps in Assign() methods if source map is empty
This commit is contained in:
@@ -168,10 +168,14 @@ public:
|
||||
return *this;
|
||||
|
||||
Clear();
|
||||
ReSize (theOther.Extent()-1);
|
||||
Iterator anIter(theOther);
|
||||
for (; anIter.More(); anIter.Next())
|
||||
Bind (anIter.Key(), anIter.Value());
|
||||
Standard_Integer anExt = theOther.Extent();
|
||||
if (anExt)
|
||||
{
|
||||
ReSize (anExt-1);
|
||||
Iterator anIter(theOther);
|
||||
for (; anIter.More(); anIter.Next())
|
||||
Bind (anIter.Key(), anIter.Value());
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user