ENH: return plain List instead of shrinking the DynamicList
Using 'return List<T>(std::move(dynList))' for transfer of content (with implicit shrinking) into a plain List, and leave copy elision to do the rest. The implicit transfer (move construct List from DynamicList) will normally invoke resize (new/delete and moving elements). With 'return dynList.shrink()', it will first invoke an internal resize (new/delete and moving elements), followed by a copy construct as a plain list. STYLE: avoid implicit cast to 'const List&' in constructors
This commit is contained in:
@ -78,7 +78,7 @@ Foam::labelList Foam::functionObjects::vtkWrite::getSelectedPatches
|
||||
}
|
||||
}
|
||||
|
||||
return patchIDs.shrink();
|
||||
return labelList(std::move(patchIDs));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user