Clazy warnings.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-11-24 13:09:30 +02:00
parent 1217616813
commit 9cc97ef602

View File

@ -1956,6 +1956,7 @@ QList<VToolSeamAllowance *> VToolSeamAllowance::SelectedTools() const
if (not list.isEmpty()) if (not list.isEmpty())
{ {
tools.reserve(list.size());
for(auto item : list) for(auto item : list)
{ {
VToolSeamAllowance *tool = qgraphicsitem_cast<VToolSeamAllowance *>(item); VToolSeamAllowance *tool = qgraphicsitem_cast<VToolSeamAllowance *>(item);
@ -2074,6 +2075,7 @@ QVector<CustomSARecord> VToolSeamAllowance::DuplicateCustomSARecords(const QVect
const QMap<quint32, quint32> &replacements) const QMap<quint32, quint32> &replacements)
{ {
QVector<CustomSARecord> newRecords; QVector<CustomSARecord> newRecords;
newRecords.reserve(records.size());
for(auto record : records) for(auto record : records)
{ {
record.path = DuplicatePiecePath(record.path, initData); record.path = DuplicatePiecePath(record.path, initData);
@ -2089,6 +2091,7 @@ QVector<quint32> VToolSeamAllowance::DuplicateInternalPaths(const QVector<quint3
const VToolSeamAllowanceInitData &initData) const VToolSeamAllowanceInitData &initData)
{ {
QVector<quint32> newPaths; QVector<quint32> newPaths;
newPaths.reserve(iPaths.size());
for(auto iPath : iPaths) for(auto iPath : iPaths)
{ {
newPaths.append(DuplicatePiecePath(iPath, initData)); newPaths.append(DuplicatePiecePath(iPath, initData));
@ -2101,6 +2104,7 @@ QVector<quint32> VToolSeamAllowance::DuplicatePins(const QVector<quint32> &pins,
const VToolSeamAllowanceInitData &initData) const VToolSeamAllowanceInitData &initData)
{ {
QVector<quint32> newPins; QVector<quint32> newPins;
newPins.reserve(pins.size());
for(auto p : pins) for(auto p : pins)
{ {
QSharedPointer<VPointF> pin = initData.data->GeometricObject<VPointF>(p); QSharedPointer<VPointF> pin = initData.data->GeometricObject<VPointF>(p);
@ -2130,6 +2134,7 @@ QVector<quint32> VToolSeamAllowance::DuplicatePlaceLabels(const QVector<quint32>
const VToolSeamAllowanceInitData &initData) const VToolSeamAllowanceInitData &initData)
{ {
QVector<quint32> newPlaceLabels; QVector<quint32> newPlaceLabels;
newPlaceLabels.reserve(placeLabels.size());
for(auto placeLabel : placeLabels) for(auto placeLabel : placeLabels)
{ {
QSharedPointer<VPlaceLabelItem> label = initData.data->GeometricObject<VPlaceLabelItem>(placeLabel); QSharedPointer<VPlaceLabelItem> label = initData.data->GeometricObject<VPlaceLabelItem>(placeLabel);
@ -2164,6 +2169,7 @@ QVector<VPieceNode> VToolSeamAllowance::DuplicateNodes(const VPiecePath &path,
QMap<quint32, quint32> &replacements) QMap<quint32, quint32> &replacements)
{ {
QVector<VPieceNode> nodes; QVector<VPieceNode> nodes;
nodes.reserve(path.CountNodes());
for (int i = 0; i< path.CountNodes(); ++i) for (int i = 0; i< path.CountNodes(); ++i)
{ {
VPieceNode nodeD = path.at(i); VPieceNode nodeD = path.at(i);