diff options
author | Paul Gilbert | 2018-12-28 20:45:45 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-28 20:45:45 -0800 |
commit | f218400d3b75ee1cf537e2ca9db23bc417475c10 (patch) | |
tree | 9df92800bb53d36da552dae2d5798d7b34ca0fd3 /engines/glk/alan2 | |
parent | 787a62c62d3a5864f0d221ca9acf12b8b332239b (diff) | |
download | scummvm-rg350-f218400d3b75ee1cf537e2ca9db23bc417475c10.tar.gz scummvm-rg350-f218400d3b75ee1cf537e2ca9db23bc417475c10.tar.bz2 scummvm-rg350-f218400d3b75ee1cf537e2ca9db23bc417475c10.zip |
GLK: Simplify arrays of valid extensions in detection code
Suggested by Sev as a way to avoid having both arrays and array sizes
Diffstat (limited to 'engines/glk/alan2')
-rw-r--r-- | engines/glk/alan2/detection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/glk/alan2/detection.cpp b/engines/glk/alan2/detection.cpp index d51a109c5e..175c3d61fc 100644 --- a/engines/glk/alan2/detection.cpp +++ b/engines/glk/alan2/detection.cpp @@ -46,7 +46,7 @@ Alan2Descriptor Alan2MetaEngine::findGame(const char *gameId) { } bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) { - const char *const EXTENSIONS[2] = { ".acd", ".dat" }; + const char *const EXTENSIONS[] = { ".acd", ".dat", nullptr }; // Loop through the files of the folder for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { @@ -55,8 +55,8 @@ bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g continue; Common::String filename = file->getName(); bool hasExt = false; - for (int idx = 0; idx < 2 && !hasExt; ++idx) - hasExt = filename.hasSuffixIgnoreCase(EXTENSIONS[idx]); + for (const char *const *ext = &EXTENSIONS[0]; *ext && !hasExt; ++ext) + hasExt = filename.hasSuffixIgnoreCase(*ext); if (!hasExt) continue; |