filter/Plugin: eliminate filter_new()

This commit is contained in:
Max Kellermann 2018-01-02 23:00:16 +01:00
parent b0199245d5
commit b13ebe3ddb
2 changed files with 1 additions and 21 deletions

View File

@ -27,14 +27,6 @@
#include <assert.h>
std::unique_ptr<PreparedFilter>
filter_new(const FilterPlugin *plugin, const ConfigBlock &block)
{
assert(plugin != nullptr);
return plugin->init(block);
}
std::unique_ptr<PreparedFilter>
filter_configured_new(const ConfigBlock &block)
{
@ -47,5 +39,5 @@ filter_configured_new(const ConfigBlock &block)
throw FormatRuntimeError("No such filter plugin: %s",
plugin_name);
return filter_new(plugin, block);
return plugin->init(block);
}

View File

@ -40,18 +40,6 @@ struct FilterPlugin {
std::unique_ptr<PreparedFilter> (*init)(const ConfigBlock &block);
};
/**
* Creates a new instance of the specified filter plugin.
*
* Throws std::runtime_error on error.
*
* @param plugin the filter plugin
* @param block configuration section
*/
std::unique_ptr<PreparedFilter>
filter_new(const FilterPlugin *plugin,
const ConfigBlock &block);
/**
* Creates a new filter, loads configuration and the plugin name from
* the specified configuration section.