From 10ab9e452838005a4405ba99b1920efb5a2ee846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Breno=20Rodrigues=20Guimar=C3=A3es?= Date: Thu, 16 Apr 2020 08:13:13 -0300 Subject: [PATCH] Make ParkLoadResult move friendly (#11297) This patch changes the member of ParkLoadResult to not be const. Const members cannot be moved so trying to move ParkLoadResult actually causes a copy. It also adds std::move to move the parameter to the member, otherwise a copy happens. See: https://godbolt.org/z/L4Wakb --- src/openrct2/ParkImporter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index c65c977e69..fe65ace40d 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -35,10 +35,10 @@ struct scenario_index_entry; struct ParkLoadResult final { public: - std::vector const RequiredObjects; + std::vector RequiredObjects; explicit ParkLoadResult(std::vector&& requiredObjects) - : RequiredObjects(requiredObjects) + : RequiredObjects(std::move(requiredObjects)) { } };