From 4e7fa4a4ceb4650048cfb693f53b3044cb01c62c Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Fri, 21 Feb 2025 17:47:09 +0000 Subject: [PATCH] Use std::find_if rather than loop. --- src/properties.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/properties.cpp b/src/properties.cpp index c6430adb38..ad823e29c3 100644 --- a/src/properties.cpp +++ b/src/properties.cpp @@ -5033,8 +5033,7 @@ const XmpPropertyInfo* XmpProperties::propertyInfo(const XmpKey& key) { std::string property = key.tagName(); // If property is a path for a nested property, determines the innermost element if (auto i = property.find_last_of('/'); i != std::string::npos) { - for (; i != std::string::npos && !isalpha(property.at(i)); ++i) { - } + i = std::distance(property.begin(), std::find_if(property.begin() + i, property.end(), isalpha)); property = property.substr(i); i = property.find_first_of(':'); if (i != std::string::npos) {