Skip to content

Commit 07e4add

Browse files
authored
Merge pull request #1871 from alicevision/dev/removeStatic
[image] Remove `static` keyword from `isSupported` and `getSupportedExtensions`
2 parents e323a27 + e46b5bf commit 07e4add

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/aliceVision/image/io.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,23 @@ std::vector<std::string> getSupportedExtensions()
200200
{
201201
std::vector<std::string> supportedExtensions;
202202

203-
// Map containing the parsed "extension_list" with each supported format and its associated extensions
204-
static std::map<std::string, std::vector<std::string>> extensionList = oiio::get_extension_map();
205-
206-
for (auto& format : extensionList)
203+
// oiio::get_extension_map() contains the parsed "extension_list" with each
204+
// supported format and its associated extensions
205+
for (const auto& [formatName, extensions] : oiio::get_extension_map())
207206
{
208-
for (auto& extension : format.second)
207+
for (const auto& extension : extensions)
209208
{
210-
supportedExtensions.push_back(extension.insert(0, "."));
209+
supportedExtensions.push_back("." + extension);
211210
}
212211
}
212+
213213
return supportedExtensions;
214214
}
215215

216216
bool isSupported(const std::string& extension)
217217
{
218-
static const std::vector<std::string> supportedExtensions = getSupportedExtensions();
218+
const std::vector<std::string> supportedExtensions = getSupportedExtensions();
219+
219220
const auto start = supportedExtensions.begin();
220221
const auto end = supportedExtensions.end();
221222
return (std::find(start, end, boost::to_lower_copy(extension)) != end);

0 commit comments

Comments
 (0)