From f93c9fdd15360ba4f1cea4fadc345bd240119810 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 24 Apr 2022 17:46:36 +0200 Subject: [PATCH] Small optimization. --- modules/wfc/tiling_wave_form_collapse.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/wfc/tiling_wave_form_collapse.cpp b/modules/wfc/tiling_wave_form_collapse.cpp index 8d9f33aab..d5626bf0e 100644 --- a/modules/wfc/tiling_wave_form_collapse.cpp +++ b/modules/wfc/tiling_wave_form_collapse.cpp @@ -511,9 +511,11 @@ Array2D TilingWaveFormCollapse::id_to_tiling(Array2D ids) { IdToTilePair oriented_tile = id_to_oriented_tile[id]; + const Array2D &tile = tiles[oriented_tile.id].data[oriented_tile.oriented_tile]; + for (int y = 0; y < size; y++) { for (int x = 0; x < size; x++) { - tiling.get(i * size + y, j * size + x) = tiles[oriented_tile.id].data[oriented_tile.oriented_tile].get(y, x); + tiling.get(i * size + y, j * size + x) = tile.get(y, x); } } }