From 975e4f99084a36d7d3c636cb5520c326b425cf0c Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 25 Apr 2020 01:26:06 +0200 Subject: [PATCH] Fix warning -Wrange-loop-construct apps/openmw/mwgui/loadingscreen.cpp:81:36: warning: loop variable 'extension' of type 'const std::__cxx11::basic_string' creates a copy from type 'const std::__cxx11::basic_string' [-Wrange-loop-construct] for(auto const extension: supported_extensions) ^ apps/openmw/mwgui/loadingscreen.cpp:81:25: note: use reference type 'const std::__cxx11::basic_string &' to prevent copying for(auto const extension: supported_extensions) ^~~~~~~~~~~~~~~~~~~~~ & --- apps/openmw/mwgui/loadingscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 54382ab4d..7ab39915f 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -78,7 +78,7 @@ namespace MWGui size_t pos = name.find_last_of('.'); if (pos != std::string::npos) { - for(auto const extension: supported_extensions) + for(auto const& extension: supported_extensions) { if (name.compare(pos, name.size() - pos, extension) == 0) {