diff options
author | Max Kellermann <max@duempel.org> | 2013-10-21 22:02:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-21 22:02:19 +0200 |
commit | 74904b9cf2fe163c0ae1d53fb73b19826b256812 (patch) | |
tree | 5c7ee7cc1358b897d5734c14bba2f8c704e1c861 /src/DecoderList.cxx | |
parent | 82059645f18e4a8aa734e0a376d10bb52fc1cc7d (diff) | |
download | mpd-74904b9cf2fe163c0ae1d53fb73b19826b256812.tar.gz mpd-74904b9cf2fe163c0ae1d53fb73b19826b256812.tar.xz mpd-74904b9cf2fe163c0ae1d53fb73b19826b256812.zip |
DecoderList: reimplement _for_each() with function object
Diffstat (limited to 'src/DecoderList.cxx')
-rw-r--r-- | src/DecoderList.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/DecoderList.cxx b/src/DecoderList.cxx index 8fa821f58..2f957d970 100644 --- a/src/DecoderList.cxx +++ b/src/DecoderList.cxx @@ -180,9 +180,9 @@ decoder_plugin_from_mime_type(const char *mimeType, unsigned int next) const struct DecoderPlugin * decoder_plugin_from_name(const char *name) { - decoder_plugins_for_each_enabled(plugin) - if (strcmp(plugin->name, name) == 0) - return plugin; + decoder_plugins_find([=](const DecoderPlugin &plugin){ + return strcmp(plugin.name, name) == 0; + }); return nullptr; } @@ -233,6 +233,7 @@ void decoder_plugin_init_all(void) void decoder_plugin_deinit_all(void) { - decoder_plugins_for_each_enabled(plugin) - plugin->Finish(); + decoder_plugins_for_each_enabled([=](const DecoderPlugin &plugin){ + plugin.Finish(); + }); } |