Skip to content

Commit

Permalink
perf: Small list preallocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammin committed May 25, 2024
1 parent 4825f28 commit 9566734
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private bool ReformatRectMetaData(List<TilesetRectangle> srcRects)
/// </summary>
private List<TilesetRectangle> ReadSourceRectsFromJsonDefinition(TilesetDefinition def)
{
List<TilesetRectangle> rects = new List<TilesetRectangle>();
List<TilesetRectangle> rects = new List<TilesetRectangle>(def.CHei * def.CWid);
//Debug.Log($"The tileset {def.Identifier} uses {usedTiles.Count} unique tiles");
//int id = -1;
int padding = def.Padding;
Expand Down

0 comments on commit 9566734

Please sign in to comment.