mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 07:14:31 +01:00
Remove unnecessary null checks
static_cast on a nullptr is defined behaviour.
This commit is contained in:
@@ -64,6 +64,6 @@ void TerrainEdgeObject::ReadJson(IReadObjectContext* context, json_t& root)
|
||||
TerrainEdgeObject* TerrainEdgeObject::GetById(ObjectEntryIndex entryIndex)
|
||||
{
|
||||
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objMgr.GetLoadedObject(ObjectType::TerrainEdge, entryIndex);
|
||||
return obj != nullptr ? static_cast<TerrainEdgeObject*>(obj) : nullptr;
|
||||
auto* obj = objMgr.GetLoadedObject(ObjectType::TerrainEdge, entryIndex);
|
||||
return static_cast<TerrainEdgeObject*>(obj);
|
||||
}
|
||||
|
||||
@@ -160,6 +160,6 @@ uint32_t TerrainSurfaceObject::GetImageId(
|
||||
TerrainSurfaceObject* TerrainSurfaceObject::GetById(ObjectEntryIndex entryIndex)
|
||||
{
|
||||
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objMgr.GetLoadedObject(ObjectType::TerrainSurface, entryIndex);
|
||||
return obj != nullptr ? static_cast<TerrainSurfaceObject*>(obj) : nullptr;
|
||||
auto* obj = objMgr.GetLoadedObject(ObjectType::TerrainSurface, entryIndex);
|
||||
return static_cast<TerrainSurfaceObject*>(obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user