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:
isn
2018-01-15 20:29:14 +03:00
committed by bugmaster
parent 8e45500e21
commit 229add784f
7 changed files with 126 additions and 39 deletions

View File

@@ -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;
}