[vlc-commits] mkv: ebml_dispatcher: simplify with constructor and auto

Alexandre Janniaux git at videolan.org
Tue Oct 27 09:45:14 CET 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Sat Jun 20 11:29:16 2020 +0200| [9326b59cb170a5243f7e9b691ea3b5d9d209fdb4] | committer: Alexandre Janniaux

mkv: ebml_dispatcher: simplify with constructor and auto

Simplify code using auto for iterators.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9326b59cb170a5243f7e9b691ea3b5d9d209fdb4
---

 modules/demux/mkv/Ebml_dispatcher.hpp | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/demux/mkv/Ebml_dispatcher.hpp b/modules/demux/mkv/Ebml_dispatcher.hpp
index 985bb4565d..987cce58df 100644
--- a/modules/demux/mkv/Ebml_dispatcher.hpp
+++ b/modules/demux/mkv/Ebml_dispatcher.hpp
@@ -74,18 +74,14 @@ namespace {
         if ( element == nullptr )
             return false;
 
-        EbmlProcessorEntry eb = EbmlProcessorEntry (
-          static_cast<EbmlId const&> (*element), NULL
-        );
+        EbmlProcessorEntry eb(static_cast<EbmlId const&> (*element), NULL);
 
         // --------------------------------------------------------------
         // Find the appropriate callback for the received EbmlElement
         // --------------------------------------------------------------
 
-        ProcessorContainer::const_iterator cit_end = _processors.end();
-        ProcessorContainer::const_iterator cit     = std::lower_bound (
-            _processors.begin(), cit_end, eb
-        );
+        auto cit_end = _processors.cend();
+        auto cit     = std::lower_bound(_processors.cbegin(), cit_end, eb);
 
         /* Check that the processor is valid and unique. */
         if (cit != cit_end &&



More information about the vlc-commits mailing list