Fix clang-tidy performance-move-const-argument warnings (moving trivially copyable)

This commit is contained in:
Tim Wojtulewicz 2025-04-25 15:13:02 -07:00
parent 144a3dee3a
commit ad4694f529
3 changed files with 8 additions and 8 deletions

View file

@ -49,6 +49,6 @@ bool ScannedFile::AlreadyScanned() const {
SignatureFile::SignatureFile(std::string file) : file(std::move(file)) {} SignatureFile::SignatureFile(std::string file) : file(std::move(file)) {}
SignatureFile::SignatureFile(std::string file, std::string full_path, Location load_location) SignatureFile::SignatureFile(std::string file, std::string full_path, Location load_location)
: file(std::move(file)), full_path(std::move(full_path)), load_location(std::move(load_location)) {} : file(std::move(file)), full_path(std::move(full_path)), load_location(load_location) {}
} // namespace zeek::detail } // namespace zeek::detail

View file

@ -539,7 +539,7 @@ void Manager::DoInitPostScript() {
reporter->FatalError("Invalid Broker::web_socket_overflow_policy: %s", web_socket_overflow_policy); reporter->FatalError("Invalid Broker::web_socket_overflow_policy: %s", web_socket_overflow_policy);
} }
broker::configuration config{std::move(options)}; broker::configuration config{options};
config.openssl_cafile(get_option("Broker::ssl_cafile")->AsString()->CheckString()); config.openssl_cafile(get_option("Broker::ssl_cafile")->AsString()->CheckString());
config.openssl_capath(get_option("Broker::ssl_capath")->AsString()->CheckString()); config.openssl_capath(get_option("Broker::ssl_capath")->AsString()->CheckString());
@ -911,7 +911,7 @@ bool Manager::PublishIdentifier(std::string topic, std::string id) {
return false; return false;
} }
broker::zeek::IdentifierUpdate msg(std::move(id), std::move(data.value_)); broker::zeek::IdentifierUpdate msg(std::move(id), data.value_);
DBG_LOG(DBG_BROKER, "Publishing id-update: %s", RenderMessage(topic, msg.as_data()).c_str()); DBG_LOG(DBG_BROKER, "Publishing id-update: %s", RenderMessage(topic, msg.as_data()).c_str());
bstate->endpoint.publish(std::move(topic), msg.move_data()); bstate->endpoint.publish(std::move(topic), msg.move_data());
num_ids_outgoing_metric->Inc(); num_ids_outgoing_metric->Inc();
@ -952,8 +952,8 @@ bool Manager::PublishLogCreate(EnumVal* stream, EnumVal* writer, const logging::
} }
std::string topic = default_log_topic_prefix + stream_id; std::string topic = default_log_topic_prefix + stream_id;
auto bstream_id = broker::enum_value(std::move(stream_id)); auto bstream_id = broker::enum_value(stream_id);
auto bwriter_id = broker::enum_value(std::move(writer_id)); auto bwriter_id = broker::enum_value(writer_id);
broker::zeek::LogCreate msg(std::move(bstream_id), std::move(bwriter_id), std::move(writer_info), broker::zeek::LogCreate msg(std::move(bstream_id), std::move(bwriter_id), std::move(writer_info),
std::move(fields_data)); std::move(fields_data));
@ -1029,8 +1029,8 @@ bool Manager::PublishLogWrite(EnumVal* stream, EnumVal* writer, const string& pa
std::string topic = v->AsString()->CheckString(); std::string topic = v->AsString()->CheckString();
auto bstream_id = broker::enum_value(std::move(stream_id)); auto bstream_id = broker::enum_value(stream_id);
auto bwriter_id = broker::enum_value(std::move(writer_id)); auto bwriter_id = broker::enum_value(writer_id);
broker::zeek::LogWrite msg(std::move(bstream_id), std::move(bwriter_id), std::move(path), std::move(serial_data)); broker::zeek::LogWrite msg(std::move(bstream_id), std::move(bwriter_id), std::move(path), std::move(serial_data));
DBG_LOG(DBG_BROKER, "Buffering log record: %s", RenderMessage(topic, msg.as_data()).c_str()); DBG_LOG(DBG_BROKER, "Buffering log record: %s", RenderMessage(topic, msg.as_data()).c_str());

View file

@ -636,7 +636,7 @@ void Manager::InitPostScript() {
auto spicy_config = ::spicy::rt::configuration::get(); auto spicy_config = ::spicy::rt::configuration::get();
spicy_config.hook_accept_input = hook_accept_input; spicy_config.hook_accept_input = hook_accept_input;
spicy_config.hook_decline_input = hook_decline_input; spicy_config.hook_decline_input = hook_decline_input;
::spicy::rt::configuration::set(std::move(spicy_config)); ::spicy::rt::configuration::set(spicy_config);
try { try {
::hilti::rt::init(); ::hilti::rt::init();