diff --git a/src/spicy/spicyz/driver.cc b/src/spicy/spicyz/driver.cc index 60345277e1..b905ac3242 100644 --- a/src/spicy/spicyz/driver.cc +++ b/src/spicy/spicyz/driver.cc @@ -93,7 +93,7 @@ Driver::Driver(std::unique_ptr glue, const char* argv0, hilti::rt: // We make our search paths relative to the plugin library, so that the // plugin installation can move around. - options.library_paths.push_back(lib_path); + options.library_paths.push_back(std::move(lib_path)); } catch ( const hilti::rt::filesystem::filesystem_error& e ) { ::hilti::logger().warning( hilti::util::fmt("invalid plugin base directory %s: %s", lib_path.native(), e.what())); diff --git a/src/spicy/spicyz/glue-compiler.cc b/src/spicy/spicyz/glue-compiler.cc index 20b09fac4b..33f68fea2c 100644 --- a/src/spicy/spicyz/glue-compiler.cc +++ b/src/spicy/spicyz/glue-compiler.cc @@ -479,19 +479,19 @@ bool GlueCompiler::loadEvtFile(hilti::rt::filesystem::path& path) { if ( looking_at(*chunk, 0, "protocol") ) { auto a = parseProtocolAnalyzer(*chunk); SPICY_DEBUG(hilti::util::fmt(" Got protocol analyzer definition for %s", a.name)); - _protocol_analyzers.push_back(a); + _protocol_analyzers.push_back(std::move(a)); } else if ( looking_at(*chunk, 0, "file") ) { auto a = parseFileAnalyzer(*chunk); SPICY_DEBUG(hilti::util::fmt(" Got file analyzer definition for %s", a.name)); - _file_analyzers.push_back(a); + _file_analyzers.push_back(std::move(a)); } else if ( looking_at(*chunk, 0, "packet") ) { auto a = parsePacketAnalyzer(*chunk); SPICY_DEBUG(hilti::util::fmt(" Got packet analyzer definition for %s", a.name)); - _packet_analyzers.push_back(a); + _packet_analyzers.push_back(std::move(a)); } else if ( looking_at(*chunk, 0, "on") ) { @@ -562,7 +562,7 @@ bool GlueCompiler::loadEvtFile(hilti::rt::filesystem::path& path) { } for ( auto&& ev : new_events ) - _events.push_back(ev); + _events.push_back(std::move(ev)); return true; } @@ -879,7 +879,7 @@ glue::Event GlueCompiler::parseEvent(const std::string& chunk) { eat_token(chunk, &i, ","); auto expr = extract_expr(chunk, &i); - ev.exprs.push_back(expr); + ev.exprs.push_back(std::move(expr)); first = false; } @@ -945,7 +945,7 @@ glue::Export GlueCompiler::parseExport(const std::string& chunk) { if ( looking_at(chunk, i, "&log") ) { eat_token(chunk, &i, "&log"); - export_.logs.insert(field); + export_.logs.insert(std::move(field)); } if ( looking_at(chunk, i, "}") ) { @@ -1193,7 +1193,7 @@ bool GlueCompiler::PopulateEvents() { acc.expression = e; acc.location = ev.location; // acc.dollar_id = util::startsWith(e, "$"); - ev.expression_accessors.push_back(acc); + ev.expression_accessors.push_back(std::move(acc)); } }