1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 19:56:13 +01:00

Refactor to use push_back more efficient (#13726)

This commit is contained in:
skdltmxn
2021-01-09 05:59:55 +09:00
committed by GitHub
parent d53a94861d
commit b0a8ebc808
37 changed files with 71 additions and 88 deletions

View File

@@ -152,7 +152,7 @@ void RideObject::ReadLegacy(IReadObjectContext* context, IStream* stream)
entry[2].y = stream->ReadValue<int8_t>();
stream->ReadValue<uint16_t>(); // Skip blanks
_peepLoadingWaypoints[i].push_back(entry);
_peepLoadingWaypoints[i].push_back(std::move(entry));
}
}
else
@@ -695,15 +695,13 @@ std::vector<rct_ride_entry_vehicle> RideObject::ReadJsonCars(json_t& jCars)
{
if (jCar.is_object())
{
auto car = ReadJsonCar(jCar);
cars.push_back(car);
cars.push_back(ReadJsonCar(jCar));
}
}
}
else if (jCars.is_object())
{
auto car = ReadJsonCar(jCars);
cars.push_back(car);
cars.push_back(ReadJsonCar(jCars));
}
return cars;
@@ -777,7 +775,7 @@ rct_ride_entry_vehicle RideObject::ReadJsonCar(json_t& jCar)
}
}
car.peep_loading_waypoints.push_back(entry);
car.peep_loading_waypoints.push_back(std::move(entry));
}
}
}