mirror of
https://github.com/taglib/taglib.git
synced 2026-07-13 14:51:05 -04:00
manual range loop conversions (#1126)
* manual range loop conversions Signed-off-by: Rosen Penev <rosenp@gmail.com> * Restore const containers where non const temporaries are iterated * Use std::as_const() instead of const container copies where possible --------- Signed-off-by: Rosen Penev <rosenp@gmail.com> Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
This commit is contained in:
@@ -30,8 +30,9 @@
|
||||
#include "modfileprivate.h"
|
||||
#include "tpropertymap.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <utility>
|
||||
|
||||
using namespace TagLib;
|
||||
using namespace XM;
|
||||
@@ -319,9 +320,8 @@ public:
|
||||
unsigned int size() const override
|
||||
{
|
||||
unsigned int size = 0;
|
||||
for(auto i = m_readers.begin();
|
||||
i != m_readers.end(); ++ i) {
|
||||
size += (*i)->size();
|
||||
for(const auto &reader : m_readers) {
|
||||
size += reader->size();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@@ -329,9 +329,10 @@ public:
|
||||
unsigned int read(TagLib::File &file, unsigned int limit) override
|
||||
{
|
||||
unsigned int sumcount = 0;
|
||||
for(auto i = m_readers.cbegin();
|
||||
limit > 0 && i != m_readers.cend(); ++ i) {
|
||||
unsigned int count = (*i)->read(file, limit);
|
||||
for(const auto &reader : std::as_const(m_readers)) {
|
||||
if(limit == 0)
|
||||
break;
|
||||
unsigned int count = reader->read(file, limit);
|
||||
limit -= count;
|
||||
sumcount += count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user