From 74904b9cf2fe163c0ae1d53fb73b19826b256812 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Oct 2013 22:02:19 +0200 Subject: DecoderList: reimplement _for_each() with function object --- src/DecoderList.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/DecoderList.cxx') 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(); + }); } -- cgit v1.2.3