aboutsummaryrefslogtreecommitdiffstats
path: root/taglib
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2024-01-30 19:42:06 -0800
committerUrs Fleisch <ufleisch@users.sourceforge.net>2025-10-25 13:00:24 +0200
commit49be371caab517a6e2c35a6038b8eeb12c9b82ae (patch)
treef8571774c185660271d4a6398fd22ffacdeefa81 /taglib
parentcbb3de68364e2b2f31461551be26592285d93add (diff)
std::accumulate conversionHEADupstream/master
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'taglib')
-rw-r--r--taglib/ogg/xiphcomment.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/taglib/ogg/xiphcomment.cpp b/taglib/ogg/xiphcomment.cpp
index 0e7b520e..6c31462e 100644
--- a/taglib/ogg/xiphcomment.cpp
+++ b/taglib/ogg/xiphcomment.cpp
@@ -25,6 +25,7 @@
#include "xiphcomment.h"
+#include <numeric>
#include <utility>
#include "tdebug.h"
@@ -184,14 +185,8 @@ bool Ogg::XiphComment::isEmpty() const
unsigned int Ogg::XiphComment::fieldCount() const
{
- unsigned int count = 0;
-
- for(const auto &[_, list] : std::as_const(d->fieldListMap))
- count += list.size();
-
- count += d->pictureList.size();
-
- return count;
+ auto f = [](unsigned int c, const auto &p) { return c + p.second.size(); };
+ return std::accumulate(d->fieldListMap.cbegin(), d->fieldListMap.cend(), d->pictureList.size(), f);
}
const Ogg::FieldListMap &Ogg::XiphComment::fieldListMap() const