From a881efbf261f901ceac20286e46c6251c473bc17 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 22 Sep 2020 16:38:43 -0400 Subject: [PATCH] ips_layer: Eliminate a redundant copy in Parse() Prevents unnecessary copying of the line being parsed. --- src/core/file_sys/ips_layer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index a08a70efdf..dd779310f8 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -245,9 +245,11 @@ void IPSwitchCompiler::Parse() { // Read rest of patch while (true) { - if (i + 1 >= lines.size()) + if (i + 1 >= lines.size()) { break; - const auto patch_line = lines[++i]; + } + + const auto& patch_line = lines[++i]; // Start of new patch if (StartsWith(patch_line, "@enabled") || StartsWith(patch_line, "@disabled")) {