diff --git a/Applications/DataExplorer/VtkVis/VtkRaster.cpp b/Applications/DataExplorer/VtkVis/VtkRaster.cpp index 7d0ae1125aad9fd8480693a260cbb96920d09fc7..91d6e4a817afc259401895e0e0e6414a09d28ea4 100644 --- a/Applications/DataExplorer/VtkVis/VtkRaster.cpp +++ b/Applications/DataExplorer/VtkVis/VtkRaster.cpp @@ -316,12 +316,14 @@ std::string VtkRaster::findWorldFile(std::string const& filename) ".bpw", ".bmpw", ".bpwx", ".wld" }; - for (auto& ext : supported_extensions) + auto const res = + std::find_if(supported_extensions.begin(), supported_extensions.end(), + [&no_ext](auto const& ext) -> bool { + return BaseLib::IsFileExisting(no_ext + ext); + }); + if (res != supported_extensions.end()) { - if (BaseLib::IsFileExisting(no_ext + ext)) - { - return no_ext + ext; - } + return no_ext + *res; } // no world file found