From: Rosen Penev Date: Sun, 17 May 2020 01:48:51 +0000 (-0700) Subject: [clang-tidy] use empty() X-Git-Tag: release-1.6.0~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4eb06cf81b8a08d8cde727adcd4b700e1e1206dc;p=libmatroska [clang-tidy] use empty() Found with readability-container-size-empty Signed-off-by: Rosen Penev --- diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index 03aa4e0..c2f406c 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -113,7 +113,7 @@ KaxBlockGroup::KaxBlockGroup(EBML_EXTRA_DEF) bool KaxInternalBlock::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, bool invisible) { SetValueIsSet(); - if (myBuffers.size() == 0) { + if (myBuffers.empty()) { // first frame Timecode = timecode; TrackNumber = track.TrackNumber(); @@ -270,7 +270,7 @@ filepos_t KaxBlockVirtual::UpdateSize(bool /* bSaveDefault */, bool /* bForceRen */ filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool /* bForceRender */, bool /* bSaveDefault */) { - if (myBuffers.size() == 0) { + if (myBuffers.empty()) { return 0; } else { assert(TrackNumber < 0x4000); diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp index 8390b61..65616eb 100644 --- a/src/KaxCluster.cpp +++ b/src/KaxCluster.cpp @@ -128,19 +128,19 @@ bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing) { - assert(Blobs.size() == 0); // mutually exclusive for the moment + assert(Blobs.empty()); // mutually exclusive for the moment return AddFrameInternal(track, timecode, buffer, MyNewBlock, NULL, NULL, lacing); } bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing) { - assert(Blobs.size() == 0); // mutually exclusive for the moment + assert(Blobs.empty()); // mutually exclusive for the moment return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, NULL, lacing); } bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing) { - assert(Blobs.size() == 0); // mutually exclusive for the moment + assert(Blobs.empty()); // mutually exclusive for the moment return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, &ForwBlock, lacing); } @@ -157,7 +157,7 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); *static_cast(Timecode) = GlobalTimecode() / GlobalTimecodeScale(); - if (Blobs.size() == 0) { + if (Blobs.empty()) { // old-school direct KaxBlockGroup // SilentTracks handling diff --git a/src/KaxCues.cpp b/src/KaxCues.cpp index ff35f70..a6c1d16 100644 --- a/src/KaxCues.cpp +++ b/src/KaxCues.cpp @@ -44,7 +44,7 @@ START_LIBMATROSKA_NAMESPACE KaxCues::~KaxCues() { - assert(myTempReferences.size() == 0); // otherwise that means you have added references and forgot to set the position + assert(myTempReferences.empty()); // otherwise that means you have added references and forgot to set the position } /* deprecated and wrong bool KaxCues::AddBlockGroup(const KaxBlockGroup & BlockRef)