[vlc-devel] [PATCH 6/8] qt: medialib: simplify condition
    Romain Vimont 
    rom1v at videolabs.io
       
    Mon Nov  9 10:58:13 CET 2020
    
    
  
Since idx is unsigned, idx >= 0.
As a consequence, m_total_count == 0 implies idx >= m_total_count.
---
 modules/gui/qt/medialibrary/mlbasemodel.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/gui/qt/medialibrary/mlbasemodel.hpp b/modules/gui/qt/medialibrary/mlbasemodel.hpp
index 5ee4bc8026..4da5f5e31d 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.hpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.hpp
@@ -253,7 +253,7 @@ protected:
             emit countChanged( static_cast<unsigned int>(m_total_count) );
         }
 
-        if ( m_total_count == 0 || idx >= m_total_count  )
+        if ( idx >= m_total_count  )
             return nullptr;
 
         if ( idx < m_query_param.i_offset ||  idx >= m_query_param.i_offset + m_item_list.size() )
-- 
2.29.2
    
    
More information about the vlc-devel
mailing list