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

Alexandre Janniaux ajanni at videolabs.io
Sat Jun 20 11:29:16 CEST 2020


Simplify code using auto for iterators.
---
 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 985bb4565d6..987cce58dfb 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 &&
-- 
2.27.0



More information about the vlc-devel mailing list