1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:53:51 +00:00

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)
                        ^~~~~~~~~~~~~~~~~~~~~
                                   &
This commit is contained in:
elsid 2020-04-25 01:26:06 +02:00
parent 3b9a51b8ac
commit 975e4f9908
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

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