From 3daf253b7f4ed8243e3262faee35219335e3e088 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Sun, 7 Mar 2021 17:31:43 +0100 Subject: Some emplace_back replacements (#5149) * replace push_back with emplace_back when a new object was created in the function call --- src/Generating/PieceGeneratorBFSTree.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Generating/PieceGeneratorBFSTree.cpp') diff --git a/src/Generating/PieceGeneratorBFSTree.cpp b/src/Generating/PieceGeneratorBFSTree.cpp index 4d9c78b45..2e26463f2 100644 --- a/src/Generating/PieceGeneratorBFSTree.cpp +++ b/src/Generating/PieceGeneratorBFSTree.cpp @@ -149,7 +149,7 @@ bool cPieceGeneratorBFSTree::TryPlacePieceAtConnector( continue; } // Fits, add it to list of possibile connections: - Connections.push_back(cConnection(**itrP, *itrC, NumCCWRotations, Weight)); + Connections.emplace_back(**itrP, *itrC, NumCCWRotations, Weight); WeightTotal += Weight; } // for itrC - Connectors[] } // for itrP - AvailablePieces[] @@ -188,7 +188,7 @@ bool cPieceGeneratorBFSTree::TryPlacePieceAtConnector( // This is the connector through which we have been connected to the parent, don't add continue; } - a_OutConnectors.push_back(cFreeConnector(PlacedPiece.get(), Conn.m_Piece->RotateMoveConnector(*itr, Conn.m_NumCCWRotations, ConnPos.x, ConnPos.y, ConnPos.z))); + a_OutConnectors.emplace_back(PlacedPiece.get(), Conn.m_Piece->RotateMoveConnector(*itr, Conn.m_NumCCWRotations, ConnPos.x, ConnPos.y, ConnPos.z)); } a_OutPieces.push_back(std::move(PlacedPiece)); -- cgit v1.2.3