From cfd863ef12f56fb0779b6c07cded831da0ad9fd8 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 11 Jul 2019 18:43:33 +0200 Subject: [PATCH] Prevent making unnecessary copies in certain tile loops (#9549) --- src/openrct2/drawing/Font.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index 41de488ae3..513ceef15a 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -208,7 +208,7 @@ void font_sprite_initialise_characters() { // Compute min and max that helps avoiding lookups for no reason. _smallestCodepointValue = std::numeric_limits::max(); - for (const auto entry : codepointOffsetMap) + for (const auto& entry : codepointOffsetMap) { _smallestCodepointValue = std::min(_smallestCodepointValue, entry.first); _biggestCodepointValue = std::max(_biggestCodepointValue, entry.first); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 860f3e02e8..bf44eb5ece 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -680,7 +680,7 @@ void track_design_mirror(rct_track_td6* td6) static void track_design_add_selection_tile(int16_t x, int16_t y) { - for (const auto tile : gMapSelectionTiles) + for (const auto& tile : gMapSelectionTiles) { if (tile.x == x && tile.y == y) {