Add some uses of std::move in constructors and simple functions for pass-by-value arguments

This commit is contained in:
Tim Wojtulewicz 2023-11-27 11:41:48 -07:00
parent 1e33467844
commit ef5b169acd
9 changed files with 15 additions and 14 deletions

View file

@ -9,9 +9,8 @@
using namespace zeek::packet_analysis;
Component::Component(const std::string& name, factory_callback arg_factory, Tag::subtype_t arg_subtype)
: plugin::Component(plugin::component::PACKET_ANALYZER, name, arg_subtype, packet_mgr->GetTagType()) {
factory = arg_factory;
}
: plugin::Component(plugin::component::PACKET_ANALYZER, name, arg_subtype, packet_mgr->GetTagType()),
factory(std::move(arg_factory)) {}
void Component::Initialize() {
InitializeTag();

View file

@ -263,7 +263,9 @@ void IPBasedAnalyzer::DumpPortDebug() {
TableValPtr IPBasedAnalyzer::ignore_checksums_nets_table = nullptr;
void IPBasedAnalyzer::SetIgnoreChecksumsNets(TableValPtr t) { IPBasedAnalyzer::ignore_checksums_nets_table = t; }
void IPBasedAnalyzer::SetIgnoreChecksumsNets(TableValPtr t) {
IPBasedAnalyzer::ignore_checksums_nets_table = std::move(t);
}
TableValPtr IPBasedAnalyzer::GetIgnoreChecksumsNets() {
if ( ! IPBasedAnalyzer::ignore_checksums_nets_table )

View file

@ -185,7 +185,7 @@ namespace detail {
IPTunnelTimer::IPTunnelTimer(double t, IPTunnelAnalyzer::IPPair p, IPTunnelAnalyzer* analyzer)
: Timer(t + BifConst::Tunnel::ip_tunnel_timeout, zeek::detail::TIMER_IP_TUNNEL_INACTIVITY),
tunnel_idx(p),
tunnel_idx(std::move(p)),
analyzer(analyzer) {}
void IPTunnelTimer::Dispatch(double t, bool is_expire) {