Fix warning -Wrange-loop-construct

apps/openmw/mwgui/loadingscreen.cpp:81:36: warning: loop variable 'extension' of type 'const std::__cxx11::basic_string<char>' creates a copy from type 'const std::__cxx11::basic_string<char>' [-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<char> &' to prevent copying
                    for(auto const extension: supported_extensions)
                        ^~~~~~~~~~~~~~~~~~~~~
                                   &
pull/578/head
elsid 5 years ago
parent 3b9a51b8ac
commit 975e4f9908
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -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)
{

Loading…
Cancel
Save