From 40a8be81c082c07038551b67da5adc23636bccd0 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 14 Aug 2019 09:33:21 -0500 Subject: [PATCH] Remove duplicate code via templated operator() --- plugins/net_plugin/net_plugin.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 740a9a28724..d81f5bc35a7 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -755,22 +755,8 @@ namespace eosio { connection_ptr c; explicit msg_handler( const connection_ptr& conn) : c(conn) {} - void operator()( const signed_block& msg ) const { - EOS_ASSERT( false, plugin_config_exception, "Not implemented, call handle_message directly instead" ); - } - void operator()( signed_block& msg ) const { - EOS_ASSERT( false, plugin_config_exception, "Not implemented, call handle_message directly instead" ); - } - void operator()( const packed_transaction& msg ) const { - EOS_ASSERT( false, plugin_config_exception, "Not implemented, call handle_message directly instead" ); - } - void operator()( packed_transaction& msg ) const { - EOS_ASSERT( false, plugin_config_exception, "Not implemented, call handle_message directly instead" ); - } - void operator()( signed_block&& msg ) const { - EOS_ASSERT( false, plugin_config_exception, "Not implemented, call handle_message directly instead" ); - } - void operator()( packed_transaction&& msg ) const { + template + void operator()( const T& ) const { EOS_ASSERT( false, plugin_config_exception, "Not implemented, call handle_message directly instead" ); }