mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
change two loops to while (#1147)
and one to for range. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
bdf50eda99
commit
48c4bf9c05
@ -269,8 +269,8 @@ void Ogg::File::writePacket(unsigned int i, const ByteVector &packet)
|
||||
// Write the pages.
|
||||
|
||||
ByteVector data;
|
||||
for(it = pages.begin(); it != pages.end(); ++it)
|
||||
data.append((*it)->render());
|
||||
for(const auto &page : pages)
|
||||
data.append(page->render());
|
||||
|
||||
const offset_t originalOffset = firstPage->fileOffset();
|
||||
const offset_t originalLength = lastPage->fileOffset() + lastPage->size() - originalOffset;
|
||||
|
@ -167,8 +167,11 @@ void RIFF::File::setChunkData(unsigned int i, const ByteVector &data)
|
||||
|
||||
// Now update the internal offsets
|
||||
|
||||
for(++it; it != d->chunks.end(); ++it)
|
||||
it = std::next(it);
|
||||
while(it != d->chunks.end()) {
|
||||
it->offset += static_cast<int>(diff);
|
||||
++it;
|
||||
}
|
||||
|
||||
// Update the global size.
|
||||
|
||||
@ -254,8 +257,10 @@ void RIFF::File::removeChunk(unsigned int i)
|
||||
removeBlock(it->offset - 8, removeSize);
|
||||
it = d->chunks.erase(it);
|
||||
|
||||
for(; it != d->chunks.end(); ++it)
|
||||
while(it != d->chunks.end()) {
|
||||
it->offset -= removeSize;
|
||||
++it;
|
||||
}
|
||||
|
||||
// Update the global size.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user