sonarlint: replace loop with find_if

Sonarlint complains about this loop for some reason. Convert to find_if
to fix.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2022-07-16 23:51:09 -07:00
parent aae02babba
commit 5a08e33fd8
+3 -6
View File
@@ -185,12 +185,9 @@ bool isXmpType(BasicIo& iIo, bool advance) {
std::string head(reinterpret_cast<const char*>(buf + start), len - start);
if (head.substr(0, 5) == "<?xml") {
// Forward to the next tag
for (size_t i = 5; i < head.size(); ++i) {
if (head[i] == '<') {
head = head.substr(i);
break;
}
}
auto it = std::find(head.begin() + 5, head.end(), '<');
if (it != head.end())
head = head.substr(std::distance(head.begin(), it));
}
if (head.size() > 9 && (head.substr(0, 9) == "<?xpacket" || head.substr(0, 10) == "<x:xmpmeta")) {
rc = true;