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/frotz/detection.cpp | |
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/frotz/detection.cpp')
-rw-r--r-- | engines/glk/frotz/detection.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp index 2ec48f9087..fbe7126116 100644 --- a/engines/glk/frotz/detection.cpp +++ b/engines/glk/frotz/detection.cpp @@ -47,7 +47,8 @@ PlainGameDescriptor FrotzMetaEngine::findGame(const char *gameId) { } bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) { - const char *const EXTENSIONS[11] = { ".z1", ".z2", ".z3", ".z4", ".z5", ".z6", ".z7", ".z8", ".zblorb", ".dat", ".zip" }; + const char *const EXTENSIONS[] = { ".z1", ".z2", ".z3", ".z4", ".z5", ".z6", ".z7", ".z8", + ".zblorb", ".dat", ".zip", nullptr }; // Loop through the files of the folder for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { @@ -56,8 +57,8 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g continue; Common::String filename = file->getName(); bool hasExt = false; - for (int idx = 0; idx < 11 && !hasExt; ++idx) - hasExt = filename.hasSuffixIgnoreCase(EXTENSIONS[idx]); + for (const char *const *ext = &EXTENSIONS[0]; *ext && !hasExt; ++ext) + hasExt = filename.hasSuffixIgnoreCase(*ext); if (!hasExt) continue; |