Optimise explosive depressurisation (#2190)

Slight increase. My whole life is staring at a profiler now.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-10-09 01:03:56 +11:00
committed by GitHub
parent 7dfb9a413c
commit b35fba18a1
2 changed files with 5 additions and 8 deletions

View File

@@ -29,12 +29,12 @@ namespace Content.Shared.Maps
/// <summary>
/// Attempts to get the turf at map indices with grid id or null if no such turf is found.
/// </summary>
public static TileRef? GetTileRef(this MapIndices mapIndices, GridId gridId)
public static TileRef? GetTileRef(this MapIndices mapIndices, GridId gridId, IMapManager mapManager = null)
{
if (!gridId.IsValid())
return null;
var mapManager = IoCManager.Resolve<IMapManager>();
mapManager ??= IoCManager.Resolve<IMapManager>();
if (!mapManager.TryGetGrid(gridId, out var grid))
return null;