From aed58f2a3f534b786e58034530592da311725b82 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 1 Oct 2016 10:47:21 -0700 Subject: [PATCH] File: Stop copying path when iterating. TODO: I bet I've made this mistake a billion other places... --- firmware/application/file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/application/file.cpp b/firmware/application/file.cpp index 46d5fe81a..ae8468921 100644 --- a/firmware/application/file.cpp +++ b/firmware/application/file.cpp @@ -130,7 +130,7 @@ static std::filesystem::path find_last_file_matching_pattern(const std::filesyst std::filesystem::path last_match; for(const auto& entry : std::filesystem::directory_iterator(u"", pattern)) { if( std::filesystem::is_regular_file(entry.status()) ) { - const auto match = entry.path(); + const auto& match = entry.path(); if( match > last_match ) { last_match = match; }