We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cbb3de6 commit 49be371Copy full SHA for 49be371
taglib/ogg/xiphcomment.cpp
@@ -25,6 +25,7 @@
25
26
#include "xiphcomment.h"
27
28
+#include <numeric>
29
#include <utility>
30
31
#include "tdebug.h"
@@ -184,14 +185,8 @@ bool Ogg::XiphComment::isEmpty() const
184
185
186
unsigned int Ogg::XiphComment::fieldCount() const
187
{
- unsigned int count = 0;
188
-
189
- for(const auto &[_, list] : std::as_const(d->fieldListMap))
190
- count += list.size();
191
192
- count += d->pictureList.size();
193
194
- 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);
195
}
196
197
const Ogg::FieldListMap &Ogg::XiphComment::fieldListMap() const
0 commit comments