mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Use emplace_back over push_back where appropriate
This commit is contained in:
parent
0d78eb1933
commit
64b78f6fb9
28 changed files with 86 additions and 86 deletions
|
@ -63,7 +63,7 @@ DNS_Mapping::DNS_Mapping(FILE* f)
|
|||
else
|
||||
req_addr = IPAddr(req_buf);
|
||||
|
||||
names.push_back(name_buf);
|
||||
names.emplace_back(name_buf);
|
||||
|
||||
for ( int i = 0; i < num_addrs; ++i )
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ DNS_Mapping::DNS_Mapping(FILE* f)
|
|||
if ( newline )
|
||||
*newline = '\0';
|
||||
|
||||
addrs.emplace_back(IPAddr(buf));
|
||||
addrs.emplace_back(buf);
|
||||
}
|
||||
|
||||
init_failed = false;
|
||||
|
@ -134,16 +134,16 @@ void DNS_Mapping::Init(struct hostent* h)
|
|||
if ( h->h_name )
|
||||
// for now, just use the official name
|
||||
// TODO: this could easily be expanded to include all of the aliases as well
|
||||
names.push_back(h->h_name);
|
||||
names.emplace_back(h->h_name);
|
||||
|
||||
if ( h->h_addr_list )
|
||||
{
|
||||
for ( int i = 0; h->h_addr_list[i] != NULL; ++i )
|
||||
{
|
||||
if ( h->h_addrtype == AF_INET )
|
||||
addrs.push_back(IPAddr(IPv4, (uint32_t*)h->h_addr_list[i], IPAddr::Network));
|
||||
addrs.emplace_back(IPv4, (uint32_t*)h->h_addr_list[i], IPAddr::Network);
|
||||
else if ( h->h_addrtype == AF_INET6 )
|
||||
addrs.push_back(IPAddr(IPv6, (uint32_t*)h->h_addr_list[i], IPAddr::Network));
|
||||
addrs.emplace_back(IPv6, (uint32_t*)h->h_addr_list[i], IPAddr::Network);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -342,7 +342,7 @@ static void parse_function_name(vector<ParseLocationRec>& result, ParseLocationR
|
|||
vector<ParseLocationRec> parse_location_string(const string& s)
|
||||
{
|
||||
vector<ParseLocationRec> result;
|
||||
result.push_back(ParseLocationRec());
|
||||
result.emplace_back();
|
||||
ParseLocationRec& plr = result[0];
|
||||
|
||||
// If PLR_FILE_AND_LINE, set this to the filename you want; for
|
||||
|
@ -531,7 +531,7 @@ void tokenize(const char* cstr, string& operation, vector<string>& arguments)
|
|||
if ( ! num_tokens )
|
||||
operation = string(str, start, len);
|
||||
else
|
||||
arguments.push_back(string(str, start, len));
|
||||
arguments.emplace_back(str, start, len);
|
||||
|
||||
++num_tokens;
|
||||
}
|
||||
|
|
|
@ -388,10 +388,10 @@ int dbg_cmd_break(DebugCmd cmd, const vector<string>& args)
|
|||
vector<ID*> choices;
|
||||
choose_global_symbols_regex(args[0], choices, true);
|
||||
for ( unsigned int i = 0; i < choices.size(); ++i )
|
||||
locstrings.push_back(choices[i]->Name());
|
||||
locstrings.emplace_back(choices[i]->Name());
|
||||
}
|
||||
else
|
||||
locstrings.push_back(args[0].c_str());
|
||||
locstrings.push_back(args[0]);
|
||||
|
||||
for ( unsigned int strindex = 0; strindex < locstrings.size(); ++strindex )
|
||||
{
|
||||
|
|
|
@ -148,7 +148,7 @@ bool File::Open(FILE* file, const char* mode)
|
|||
}
|
||||
|
||||
is_open = true;
|
||||
open_files.emplace_back(std::make_pair(name, this));
|
||||
open_files.emplace_back(name, this);
|
||||
|
||||
RaiseOpenEvent();
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ std::list<std::tuple<IPPrefix, void*>> PrefixTable::FindAll(const IPAddr& addr,
|
|||
patricia_search_all(tree, prefix, &list, &elems);
|
||||
|
||||
for ( int i = 0; i < elems; ++i )
|
||||
out.push_back(std::make_tuple(PrefixToIPPrefix(list[i]->prefix), list[i]->data));
|
||||
out.emplace_back(PrefixToIPPrefix(list[i]->prefix), list[i]->data);
|
||||
|
||||
Deref_Prefix(prefix);
|
||||
free(list);
|
||||
|
|
|
@ -24,12 +24,12 @@ void ScriptCoverageManager::AddStmt(Stmt* s)
|
|||
if ( ignoring != 0 )
|
||||
return;
|
||||
|
||||
stmts.push_back({NewRef{}, s});
|
||||
stmts.emplace_back(NewRef{}, s);
|
||||
}
|
||||
|
||||
void ScriptCoverageManager::AddFunction(IDPtr func_id, StmtPtr body)
|
||||
{
|
||||
func_instances.push_back({func_id, body});
|
||||
func_instances.emplace_back(func_id, body);
|
||||
}
|
||||
|
||||
bool ScriptCoverageManager::ReadStats()
|
||||
|
|
|
@ -37,7 +37,7 @@ const Substring& Substring::operator=(const Substring& bst)
|
|||
|
||||
void Substring::AddAlignment(const String* str, int index)
|
||||
{
|
||||
_aligns.push_back(BSSAlign(str, index));
|
||||
_aligns.emplace_back(str, index);
|
||||
}
|
||||
|
||||
bool Substring::DoesCover(const Substring* bst) const
|
||||
|
|
|
@ -2085,7 +2085,7 @@ void WhenInfo::BuildProfile()
|
|||
if ( ! is_present )
|
||||
{
|
||||
IDPtr wl_ptr = {NewRef{}, const_cast<ID*>(wl)};
|
||||
cl->emplace_back(FuncType::Capture{wl_ptr, false});
|
||||
cl->emplace_back(wl_ptr, false);
|
||||
}
|
||||
|
||||
// In addition, don't treat them as external locals that
|
||||
|
@ -2098,7 +2098,7 @@ void WhenInfo::BuildProfile()
|
|||
// We need IDPtr versions of the locals so we can manipulate
|
||||
// them during script optimization.
|
||||
auto non_const_w = const_cast<ID*>(w);
|
||||
when_expr_locals.push_back({NewRef{}, non_const_w});
|
||||
when_expr_locals.emplace_back(NewRef{}, non_const_w);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,7 @@ void Trigger::Register(const ID* const_id)
|
|||
notifier::detail::registry.Register(id, this);
|
||||
|
||||
Ref(id);
|
||||
objs.push_back({id, id});
|
||||
objs.emplace_back(id, id);
|
||||
}
|
||||
|
||||
void Trigger::Register(Val* val)
|
||||
|
|
|
@ -1196,7 +1196,7 @@ void RecordType::AddField(unsigned int field, const TypeDecl* td)
|
|||
else
|
||||
{
|
||||
auto efi = std::make_unique<detail::ExprFieldInit>(def_expr, type);
|
||||
creation_inits.emplace_back(std::make_pair(field, std::move(efi)));
|
||||
creation_inits.emplace_back(field, std::move(efi));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1793,7 +1793,7 @@ EnumType::enum_name_list EnumType::Names() const
|
|||
{
|
||||
enum_name_list n;
|
||||
for ( NameMap::const_iterator iter = names.begin(); iter != names.end(); ++iter )
|
||||
n.push_back(std::make_pair(iter->first, iter->second));
|
||||
n.emplace_back(iter->first, iter->second);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -1012,7 +1012,7 @@ StringValPtr StringVal::Replace(RE_Matcher* re, const String& repl, bool do_all)
|
|||
break;
|
||||
|
||||
// s[offset .. offset+end_of_match-1] matches re.
|
||||
cut_points.push_back({offset, offset + end_of_match});
|
||||
cut_points.emplace_back(offset, offset + end_of_match);
|
||||
|
||||
offset += end_of_match;
|
||||
n -= end_of_match;
|
||||
|
|
|
@ -222,7 +222,7 @@ void POP3_Analyzer::ProcessRequest(int length, const char* line)
|
|||
// Some clients pipeline their commands (i.e., keep sending
|
||||
// without waiting for a server's responses). Therefore we
|
||||
// keep a list of pending commands.
|
||||
cmds.push_back(std::string(line));
|
||||
cmds.emplace_back(line);
|
||||
|
||||
if ( cmds.size() == 1 )
|
||||
// Not waiting for another server response,
|
||||
|
|
|
@ -71,7 +71,7 @@ refine flow SIP_Flow += {
|
|||
|
||||
if ( build_headers )
|
||||
{
|
||||
headers.push_back({zeek::AdoptRef{}, build_sip_header_val(name, value)});
|
||||
headers.emplace_back(zeek::AdoptRef{}, build_sip_header_val(name, value));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -889,7 +889,7 @@ broker::expected<broker::data> val_to_data(const Val* v)
|
|||
std::string name(f->Name());
|
||||
|
||||
broker::vector rval;
|
||||
rval.push_back(name);
|
||||
rval.emplace_back(name);
|
||||
|
||||
if ( name.find("lambda_<") == 0 )
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ bool None::DoInit(const WriterInfo& info, int num_fields, const threading::Field
|
|||
|
||||
for ( WriterInfo::config_map::const_iterator i = info.config.begin();
|
||||
i != info.config.end(); i++ )
|
||||
keys.push_back(std::make_pair(i->first, i->second));
|
||||
keys.emplace_back(i->first, i->second);
|
||||
|
||||
std::sort(keys.begin(), keys.end());
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
return true;
|
||||
}
|
||||
|
||||
errors->push_back(util::fmt("plugin %s is not available", name.c_str()));
|
||||
errors->emplace_back(util::fmt("plugin %s is not available", name.c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
"dynamic plugin %s from directory %s conflicts with %s plugin %s (%d.%d.%d)",
|
||||
name.c_str(), dir.c_str(), p->DynamicPlugin() ? "dynamic" : "built-in",
|
||||
p->Name().c_str(), v.major, v.minor, v.patch);
|
||||
errors->push_back(error);
|
||||
errors->emplace_back(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -245,14 +245,14 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
if ( ! hdl )
|
||||
{
|
||||
const char* err = dlerror();
|
||||
errors->push_back(util::fmt("cannot load plugin library %s: %s", path,
|
||||
err ? err : "<unknown error>"));
|
||||
errors->emplace_back(util::fmt("cannot load plugin library %s: %s", path,
|
||||
err ? err : "<unknown error>"));
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! current_plugin )
|
||||
{
|
||||
errors->push_back(
|
||||
errors->emplace_back(
|
||||
util::fmt("load plugin library %s did not instantiate a plugin", path));
|
||||
dlclose(hdl);
|
||||
continue;
|
||||
|
@ -275,8 +275,8 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
|||
// what we expect from its magic file.
|
||||
if ( util::strtolower(current_plugin->Name()) != util::strtolower(name) )
|
||||
{
|
||||
errors->push_back(util::fmt("inconsistent plugin name: %s vs %s",
|
||||
current_plugin->Name().c_str(), name.c_str()));
|
||||
errors->emplace_back(util::fmt("inconsistent plugin name: %s vs %s",
|
||||
current_plugin->Name().c_str(), name.c_str()));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ Manager::inactive_plugin_list Manager::InactivePlugins() const
|
|||
}
|
||||
|
||||
if ( ! found )
|
||||
inactives.push_back(*i);
|
||||
inactives.emplace_back(*i);
|
||||
}
|
||||
|
||||
return inactives;
|
||||
|
@ -646,7 +646,7 @@ std::list<std::pair<HookType, int>> Manager::HooksEnabledForPlugin(const Plugin*
|
|||
if ( hook_list* l = hooks[i] )
|
||||
for ( const auto& [hook, hook_plugin] : *l )
|
||||
if ( hook_plugin == plugin )
|
||||
enabled.push_back(std::make_pair(static_cast<HookType>(i), hook));
|
||||
enabled.emplace_back(static_cast<HookType>(i), hook);
|
||||
}
|
||||
|
||||
return enabled;
|
||||
|
@ -666,7 +666,7 @@ void Manager::EnableHook(HookType hook, Plugin* plugin, int prio)
|
|||
return;
|
||||
}
|
||||
|
||||
l->push_back(std::make_pair(prio, plugin));
|
||||
l->emplace_back(prio, plugin);
|
||||
l->sort(hook_cmp);
|
||||
}
|
||||
|
||||
|
@ -710,9 +710,9 @@ int Manager::HookLoadFile(const Plugin::LoadType type, const string& file, const
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(type));
|
||||
args.push_back(HookArgument(file));
|
||||
args.push_back(HookArgument(resolved));
|
||||
args.emplace_back(type);
|
||||
args.emplace_back(file);
|
||||
args.emplace_back(resolved);
|
||||
MetaHookPre(HOOK_LOAD_FILE, args);
|
||||
}
|
||||
|
||||
|
@ -745,9 +745,9 @@ Manager::HookLoadFileExtended(const Plugin::LoadType type, const string& file,
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(type));
|
||||
args.push_back(HookArgument(file));
|
||||
args.push_back(HookArgument(resolved));
|
||||
args.emplace_back(type);
|
||||
args.emplace_back(file);
|
||||
args.emplace_back(resolved);
|
||||
MetaHookPre(HOOK_LOAD_FILE_EXT, args);
|
||||
}
|
||||
|
||||
|
@ -785,9 +785,9 @@ std::pair<bool, ValPtr> Manager::HookCallFunction(const Func* func, zeek::detail
|
|||
for ( const auto& v : *vecargs )
|
||||
vargs.push_back(v.get());
|
||||
|
||||
args.push_back(HookArgument(func));
|
||||
args.push_back(HookArgument(parent));
|
||||
args.push_back(HookArgument(&vargs));
|
||||
args.emplace_back(func);
|
||||
args.emplace_back(parent);
|
||||
args.emplace_back(&vargs);
|
||||
MetaHookPre(HOOK_CALL_FUNCTION, args);
|
||||
}
|
||||
|
||||
|
@ -821,7 +821,7 @@ bool Manager::HookQueueEvent(Event* event) const
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(event));
|
||||
args.emplace_back(event);
|
||||
MetaHookPre(HOOK_QUEUE_EVENT, args);
|
||||
}
|
||||
|
||||
|
@ -873,7 +873,7 @@ void Manager::HookSetupAnalyzerTree(Connection* conn) const
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(conn));
|
||||
args.emplace_back(conn);
|
||||
MetaHookPre(HOOK_SETUP_ANALYZER_TREE, args);
|
||||
}
|
||||
|
||||
|
@ -900,7 +900,7 @@ void Manager::HookUpdateNetworkTime(double network_time) const
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(network_time));
|
||||
args.emplace_back(network_time);
|
||||
MetaHookPre(HOOK_UPDATE_NETWORK_TIME, args);
|
||||
}
|
||||
|
||||
|
@ -923,7 +923,7 @@ void Manager::HookObjDtor(void* obj) const
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(obj));
|
||||
args.emplace_back(obj);
|
||||
MetaHookPre(HOOK_OBJ_DTOR, args);
|
||||
}
|
||||
|
||||
|
@ -948,13 +948,13 @@ void Manager::HookLogInit(const std::string& writer, const std::string& instanti
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(writer));
|
||||
args.push_back(HookArgument(instantiating_filter));
|
||||
args.push_back(HookArgument(local));
|
||||
args.push_back(HookArgument(remote));
|
||||
args.push_back(HookArgument(&info));
|
||||
args.push_back(HookArgument(num_fields));
|
||||
args.push_back(HookArgument(std::make_pair(num_fields, fields)));
|
||||
args.emplace_back(writer);
|
||||
args.emplace_back(instantiating_filter);
|
||||
args.emplace_back(local);
|
||||
args.emplace_back(remote);
|
||||
args.emplace_back(&info);
|
||||
args.emplace_back(num_fields);
|
||||
args.emplace_back(std::make_pair(num_fields, fields));
|
||||
MetaHookPre(HOOK_LOG_INIT, args);
|
||||
}
|
||||
|
||||
|
@ -979,12 +979,12 @@ bool Manager::HookLogWrite(const std::string& writer, const std::string& filter,
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(writer));
|
||||
args.push_back(HookArgument(filter));
|
||||
args.push_back(HookArgument(&info));
|
||||
args.push_back(HookArgument(num_fields));
|
||||
args.push_back(HookArgument(std::make_pair(num_fields, fields)));
|
||||
args.push_back(HookArgument(vals));
|
||||
args.emplace_back(writer);
|
||||
args.emplace_back(filter);
|
||||
args.emplace_back(&info);
|
||||
args.emplace_back(num_fields);
|
||||
args.emplace_back(std::make_pair(num_fields, fields));
|
||||
args.emplace_back(vals);
|
||||
MetaHookPre(HOOK_LOG_WRITE, args);
|
||||
}
|
||||
|
||||
|
@ -1021,14 +1021,14 @@ bool Manager::HookReporter(const std::string& prefix, const EventHandlerPtr even
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.push_back(HookArgument(prefix));
|
||||
args.push_back(HookArgument(conn));
|
||||
args.push_back(HookArgument(addl));
|
||||
args.push_back(HookArgument(location1));
|
||||
args.push_back(HookArgument(location2));
|
||||
args.push_back(HookArgument(location));
|
||||
args.push_back(HookArgument(time));
|
||||
args.push_back(HookArgument(message));
|
||||
args.emplace_back(prefix);
|
||||
args.emplace_back(conn);
|
||||
args.emplace_back(addl);
|
||||
args.emplace_back(location1);
|
||||
args.emplace_back(location2);
|
||||
args.emplace_back(location);
|
||||
args.emplace_back(time);
|
||||
args.emplace_back(message);
|
||||
MetaHookPre(HOOK_REPORTER, args);
|
||||
}
|
||||
|
||||
|
@ -1063,7 +1063,7 @@ void Manager::HookUnprocessedPacket(const Packet* packet) const
|
|||
|
||||
if ( HavePluginForHook(META_HOOK_PRE) )
|
||||
{
|
||||
args.emplace_back(HookArgument{packet});
|
||||
args.emplace_back(packet);
|
||||
MetaHookPre(HOOK_UNPROCESSED_PACKET, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ DefaultHasher::DefaultHasher(size_t k, Hasher::seed_t seed) : Hasher(k, seed)
|
|||
{
|
||||
seed_t s = Seed();
|
||||
s.h[0] += util::detail::prng(i);
|
||||
hash_functions.push_back(UHF(s));
|
||||
hash_functions.emplace_back(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ shared_ptr<CPP_InitInfo> CPPCompile::RegisterConstant(const ValPtr& vp, int& con
|
|||
const_vals[v] = constants[c_desc] = gi;
|
||||
|
||||
consts_offset = const_offsets[v] = constants_offsets[c_desc] = consts.size();
|
||||
consts.emplace_back(pair(tag, gi->Offset()));
|
||||
consts.emplace_back(tag, gi->Offset());
|
||||
|
||||
return gi;
|
||||
}
|
||||
|
|
|
@ -1352,7 +1352,7 @@ string CPPCompile::GenField(const ExprPtr& rec, int field)
|
|||
ASSERT(pt != processed_types.end());
|
||||
auto rt_offset = pt->second->Offset();
|
||||
string field_name = rt->FieldName(field);
|
||||
field_decls.emplace_back(pair(rt_offset, rt->FieldDecl(field)));
|
||||
field_decls.emplace_back(rt_offset, rt->FieldDecl(field));
|
||||
|
||||
if ( rfm != record_field_mappings.end() )
|
||||
// We're already tracking this record.
|
||||
|
@ -1392,7 +1392,7 @@ string CPPCompile::GenEnum(const TypePtr& t, const ValPtr& ev)
|
|||
mapping_slot = num_ev_mappings++;
|
||||
|
||||
string enum_name = et->Lookup(v);
|
||||
enum_names.emplace_back(pair(TypeOffset(t), std::move(enum_name)));
|
||||
enum_names.emplace_back(TypeOffset(t), std::move(enum_name));
|
||||
|
||||
if ( evm != enum_val_mappings.end() )
|
||||
{
|
||||
|
|
|
@ -208,7 +208,7 @@ FuncValPtr lookup_func__CPP(string name, int num_bodies, vector<p_hash_type> has
|
|||
ASSERT(cs != compiled_scripts.end());
|
||||
|
||||
const auto& f = cs->second;
|
||||
bodies.push_back(f.body);
|
||||
bodies.emplace_back(f.body);
|
||||
priorities.push_back(f.priority);
|
||||
|
||||
// This might register the same event more than once,
|
||||
|
|
|
@ -26,7 +26,7 @@ void GenIDDefs::TraverseFunction(const Func* f, ScopePtr scope, StmtPtr body)
|
|||
// Establish the outermost barrier and associated set of
|
||||
// identifiers.
|
||||
barrier_blocks.push_back(0);
|
||||
modified_IDs.push_back({});
|
||||
modified_IDs.emplace_back();
|
||||
|
||||
for ( const auto& g : pf->Globals() )
|
||||
{
|
||||
|
@ -434,7 +434,7 @@ void GenIDDefs::StartConfluenceBlock(const Stmt* s)
|
|||
barrier_blocks.push_back(confluence_blocks.size());
|
||||
|
||||
confluence_blocks.push_back(s);
|
||||
modified_IDs.push_back({});
|
||||
modified_IDs.emplace_back();
|
||||
}
|
||||
|
||||
void GenIDDefs::EndConfluenceBlock(bool no_orig)
|
||||
|
|
|
@ -77,7 +77,7 @@ void IDOptInfo::AddInitExpr(ExprPtr init_expr, InitClass ic)
|
|||
return;
|
||||
|
||||
if ( my_id->IsGlobal() )
|
||||
global_init_exprs.emplace_back(IDInitInfo(my_id, init_expr, ic));
|
||||
global_init_exprs.emplace_back(my_id, init_expr, ic);
|
||||
|
||||
init_exprs.emplace_back(std::move(init_expr));
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ void add_func_analysis_pattern(AnalyOpt& opts, const char* pat)
|
|||
try
|
||||
{
|
||||
std::string full_pat = std::string("^(") + pat + ")$";
|
||||
opts.only_funcs.emplace_back(std::regex(full_pat));
|
||||
opts.only_funcs.emplace_back(full_pat);
|
||||
}
|
||||
catch ( const std::regex_error& e )
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ void add_file_analysis_pattern(AnalyOpt& opts, const char* pat)
|
|||
try
|
||||
{
|
||||
std::string full_pat = std::string("^.*(") + pat + ").*$";
|
||||
opts.only_files.emplace_back(std::regex(full_pat));
|
||||
opts.only_files.emplace_back(full_pat);
|
||||
}
|
||||
catch ( const std::regex_error& e )
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace zeek::detail
|
|||
|
||||
void ZAMCompiler::PushGoTos(GoToSets& gotos)
|
||||
{
|
||||
gotos.push_back({});
|
||||
gotos.emplace_back();
|
||||
}
|
||||
|
||||
void ZAMCompiler::ResolveGoTos(GoToSets& gotos, const InstLabel l)
|
||||
|
|
|
@ -837,7 +837,7 @@ const ZAMStmt ZAMCompiler::LoopOverTable(const ForStmt* f, const NameExpr* val)
|
|||
aux->value_var_type = value_var->GetType();
|
||||
|
||||
auto iter_slot = table_iters.size();
|
||||
table_iters.emplace_back(TableIterInfo());
|
||||
table_iters.emplace_back();
|
||||
|
||||
auto z = ZInstI(OP_INIT_TABLE_LOOP_VV, FrameSlot(val), iter_slot);
|
||||
z.op_type = OP_VV_I2;
|
||||
|
|
|
@ -277,7 +277,7 @@ const threading::Manager::msg_stats_list& threading::Manager::GetMsgThreadStats(
|
|||
MsgThread::Stats s;
|
||||
t->GetStats(&s);
|
||||
|
||||
stats.push_back(std::make_pair(t->Name(), s));
|
||||
stats.emplace_back(t->Name(), s);
|
||||
}
|
||||
|
||||
return stats;
|
||||
|
|
|
@ -51,11 +51,11 @@ static void add_summary_rows(const ODesc& id_desc, const vector<string>& cmnts,
|
|||
ReStructuredTextTable* table)
|
||||
{
|
||||
vector<string> row;
|
||||
row.push_back(id_desc.Description());
|
||||
row.emplace_back(id_desc.Description());
|
||||
|
||||
if ( cmnts.empty() )
|
||||
{
|
||||
row.push_back("");
|
||||
row.emplace_back();
|
||||
table->AddRow(row);
|
||||
return;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ static void add_summary_rows(const ODesc& id_desc, const vector<string>& cmnts,
|
|||
for ( size_t i = 1; i < cmnts.size(); ++i )
|
||||
{
|
||||
row.clear();
|
||||
row.push_back("");
|
||||
row.emplace_back();
|
||||
row.push_back(cmnts[i]);
|
||||
table->AddRow(row);
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ vector<string> dir_contents_recursive(string dir)
|
|||
while ( (n = fts_read(fts)) )
|
||||
{
|
||||
if ( n->fts_info & FTS_F )
|
||||
rval.push_back(n->fts_path);
|
||||
rval.emplace_back(n->fts_path);
|
||||
}
|
||||
|
||||
if ( errno )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue