[vlc-commits] qt: medialib: simplify condition
Romain Vimont
git at videolan.org
Thu Nov 12 15:48:06 CET 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Mon Nov 9 10:58:13 2020 +0100| [98bf5dbc5fc726db17a64918f5e853cdf51e48ff] | committer: Alexandre Janniaux
qt: medialib: simplify condition
Since idx is unsigned, idx >= 0.
As a consequence, m_total_count == 0 implies idx >= m_total_count.
Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98bf5dbc5fc726db17a64918f5e853cdf51e48ff
---
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() )
More information about the vlc-commits
mailing list