]> granicus.if.org Git - libmatroska/commitdiff
[clang-tidy] use empty()
authorRosen Penev <rosenp@gmail.com>
Sun, 17 May 2020 01:48:51 +0000 (18:48 -0700)
committerMoritz Bunkus <moritz@bunkus.org>
Mon, 22 Jun 2020 08:34:28 +0000 (10:34 +0200)
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
src/KaxBlock.cpp
src/KaxCluster.cpp
src/KaxCues.cpp

index 03aa4e09bfded2c4a558835d23233e80e0bbfc0e..c2f406c1779c9ad352936303a17518355c0490d6 100644 (file)
@@ -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);
index 8390b61bc437f60d643d59404be1646685e71a7c..65616ebb42b62ce7d35433dd9572b2730d2cf9ea 100644 (file)
@@ -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<KaxClusterTimecode *>(this->FindElt(EBML_INFO(KaxClusterTimecode)));
   *static_cast<EbmlUInteger *>(Timecode) = GlobalTimecode() / GlobalTimecodeScale();
 
-  if (Blobs.size() == 0) {
+  if (Blobs.empty()) {
     // old-school direct KaxBlockGroup
 
     // SilentTracks handling
index ff35f709a699d19eb5044f975a88f3214d92284a..a6c1d16d0c2e31ef1dd8ff9fba276cab70546fcf 100644 (file)
@@ -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)