From 44c4aa931a0c3916f81d298bed94973b05bf808c Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 3 Jan 2021 15:17:03 +0100 Subject: [PATCH] Better use kiwix::startsWith() --- src/reader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index 67838de89..10dfc8b0a 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -120,9 +120,9 @@ unsigned int Reader::getMediaCount() const = this->parseCounterMetadata(); unsigned int counter = 0; - for (auto it = counterMap.begin(); it != counterMap.end(); ++it) { - if (it->first.rfind("image/", 0) == 0) { - counter += it->second; + for (auto &pair:counterMap) { + if (startsWith(pair.first, "image/")) { + counter += pair.second; } }