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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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))
{
}
};