mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Use std::move in a few places instead of copying a pass-by-value argument (performance-unnecessary-value-param)
This commit is contained in:
parent
5a237d3a3f
commit
d23b15c08f
4 changed files with 4 additions and 4 deletions
|
@ -255,7 +255,7 @@ public:
|
|||
using IPPair = std::pair<IPAddr, IPAddr>;
|
||||
|
||||
FlowWeirdTimer(double t, IPPair p, double timeout)
|
||||
: Timer(t + timeout, TIMER_FLOW_WEIRD_EXPIRE), endpoints(p)
|
||||
: Timer(t + timeout, TIMER_FLOW_WEIRD_EXPIRE), endpoints(std::move(p))
|
||||
{}
|
||||
|
||||
void Dispatch(double t, int is_expire) override
|
||||
|
|
|
@ -62,7 +62,7 @@ RuleHdrTest::RuleHdrTest(Prot arg_prot, Comp arg_comp, vector<IPPrefix> arg_v)
|
|||
size = 0;
|
||||
comp = arg_comp;
|
||||
vals = new maskedvalue_list;
|
||||
prefix_vals = arg_v;
|
||||
prefix_vals = std::move(arg_v);
|
||||
sibling = 0;
|
||||
child = 0;
|
||||
pattern_rules = 0;
|
||||
|
|
|
@ -394,7 +394,7 @@ bool Manager::PublishEvent(string topic, RecordVal* args)
|
|||
xs.emplace_back(data_val->data);
|
||||
}
|
||||
|
||||
return PublishEvent(topic, event_name, std::move(xs));
|
||||
return PublishEvent(std::move(topic), event_name, std::move(xs));
|
||||
}
|
||||
|
||||
bool Manager::PublishIdentifier(std::string topic, std::string id)
|
||||
|
|
|
@ -29,7 +29,7 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
|
|||
ts = *arg_ts;
|
||||
cap_len = arg_caplen;
|
||||
len = arg_len;
|
||||
tag = arg_tag;
|
||||
tag = std::move(arg_tag);
|
||||
|
||||
copy = arg_copy;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue