Commit 0085096e authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

avoid std::string::find() to check for prefix

Use compare() instead which will terminate faster if things don't match.
parent e3c051e2
......@@ -3276,7 +3276,7 @@ void SystemTools::CheckTranslationPath(std::string& path)
// Now convert any path found in the table back to the one desired:
for (auto const& pair : SystemTools::Statics->TranslationMap) {
// We need to check of the path is a substring of the other path
if (path.find(pair.first) == 0) {
if (, pair.first.size(), pair.first) == 0) {
path = path.replace(0, pair.first.size(), pair.second);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment