1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00

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
This commit is contained in:
Breno Rodrigues Guimarães
2020-04-16 08:13:13 -03:00
committed by GitHub
parent a80905e30d
commit 10ab9e4528

View File

@@ -35,10 +35,10 @@ struct scenario_index_entry;
struct ParkLoadResult final
{
public:
std::vector<rct_object_entry> const RequiredObjects;
std::vector<rct_object_entry> RequiredObjects;
explicit ParkLoadResult(std::vector<rct_object_entry>&& requiredObjects)
: RequiredObjects(requiredObjects)
: RequiredObjects(std::move(requiredObjects))
{
}
};