[vlc-commits] demux: inline one trivial function

Rémi Denis-Courmont git at videolan.org
Fri Sep 25 18:05:53 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Sep 24 17:47:49 2020 +0300| [9d858fe2e990c30fef21c8c27e1a57770d7cbccc] | committer: Rémi Denis-Courmont

demux: inline one trivial function

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

 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";
 }
 



More information about the vlc-commits mailing list