[vlc-devel] [PATCH 6/5] demux: inline one trivial function

RĂ©mi Denis-Courmont remi at remlab.net
Thu Sep 24 16:48:31 CEST 2020


---
 src/input/demux.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/input/demux.c b/src/input/demux.c
index 4a534530e5..a854037e71 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -49,12 +49,6 @@ static int demux_mapping_cmp( const void *k, const void *v )
     return vlc_ascii_strcasecmp( k, entry->key );
 }
 
-static demux_mapping* demux_lookup( char const* key,
-                                    demux_mapping* data, size_t size )
-{
-    return bsearch( key, data, size, sizeof( *data ), demux_mapping_cmp );
-}
-
 static const char *demux_NameFromMimeType(const char *mime)
 {
     static demux_mapping types[] =
@@ -69,7 +63,9 @@ static const char *demux_NameFromMimeType(const char *mime)
         { "video/nsa",           "nsv"     },
         { "video/nsv",           "nsv"     },
     };
-    demux_mapping *type = demux_lookup( mime, types, ARRAY_SIZE( types ) );
+
+    demux_mapping *type = bsearch(mime, types, ARRAY_SIZE(types),
+                                  sizeof (*types), demux_mapping_cmp);
     return (type != NULL) ? type->name : "any";
 }
 
-- 
2.28.0



More information about the vlc-devel mailing list