File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,9 @@ namespace LV {
7979 // TODO: Factor this out into a string utility library
8080 std::string to_lower_ascii (std::string const & s)
8181 {
82- std::string result {s};
83- std::transform (result. begin (), result. end (), result. begin (),
84- [=] ( unsigned char c) { return std::tolower (c); } );
82+ auto result {s};
83+ for ( auto & c : result)
84+ c = std::tolower (c);
8585 return result;
8686 }
8787
@@ -295,9 +295,10 @@ namespace LV {
295295
296296 bool Video::save_to_file (std::string const & path) const
297297 {
298- std::string extension {to_lower_ascii (fs::path {path}.extension ())};
298+ auto extension {fs::path {path}.extension ()};
299+ auto extension_lower (to_lower_ascii (extension.string ()));
299300
300- auto entry {bitmap_format_extension_map.find (extension )};
301+ auto entry {bitmap_format_extension_map.find (extension_lower )};
301302 if (entry == bitmap_format_extension_map.end ()) {
302303 visual_log (VISUAL_LOG_ERROR, " Could not deduce format from filename (%s)" , path.c_str ());
303304 return false ;
You can’t perform that action at this time.
0 commit comments