File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff 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
216216bool 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);
You can’t perform that action at this time.
0 commit comments