Skip to content

Commit

Permalink
Use std::array for a list of extensions
Browse files Browse the repository at this point in the history
This list doesn't change and the size is known at compile time.
  • Loading branch information
elsid committed Apr 24, 2020
1 parent 975e4f9 commit ffacc30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/openmw/mwgui/loadingscreen.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "loadingscreen.hpp"

#include <array>

#include <osgViewer/Viewer>

#include <osg/Texture2D>
Expand Down Expand Up @@ -67,7 +69,7 @@ namespace MWGui
mVFS->normalizeFilename(pattern);

/* priority given to the left */
std::list<std::string> supported_extensions = {".tga", ".dds", ".ktx", ".png", ".bmp", ".jpeg", ".jpg"};
const std::array<std::string, 7> supported_extensions {{".tga", ".dds", ".ktx", ".png", ".bmp", ".jpeg", ".jpg"}};

auto found = index.lower_bound(pattern);
while (found != index.end())
Expand Down

0 comments on commit ffacc30

Please sign in to comment.