From: Rosen Penev Date: Tue, 27 Sep 2022 00:12:37 +0000 (-0700) Subject: manually convert some loops to range ones X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b303b8089404d2dc5efdb9f13b74f6fc6be43bf;p=libmatroska manually convert some loops to range ones --- diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index 1aa6701..3a52ef6 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -396,9 +396,9 @@ filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool /* bForceRender } // put the data of each frame - for (i=0; iBuffer(), myBuffers[i]->Size()); - SetSize_(GetSize() + myBuffers[i]->Size()); + for (const auto& myBuf : myBuffers) { + output.writeFully(myBuf->Buffer(), myBuf->Size()); + SetSize_(GetSize() + myBuf->Size()); } } diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp index 40641c9..35b5717 100644 --- a/src/KaxCluster.cpp +++ b/src/KaxCluster.cpp @@ -180,11 +180,11 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS } } else { // new school, using KaxBlockBlob - for (Index = 0; IndexIsSimpleBlock()) - PushElement( static_cast(*Blobs[Index])); + for (const auto& blob : Blobs) { + if (blob->IsSimpleBlock()) + PushElement( static_cast(*blob)); else - PushElement( static_cast(*Blobs[Index])); + PushElement( static_cast(*blob)); } // SilentTracks handling @@ -213,9 +213,8 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS Result = EbmlMaster::Render(output, bSaveDefault); // For all Blocks add their position on the CueEntry - for (Index = 0; Index