From 1760d99c49afce0d6820bca35692829ab2576684 Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Mon, 2 Jun 2025 08:45:32 +0200 Subject: [PATCH] Prefer `std::move` over copy --- src/cluster/cluster.bif | 3 ++- .../serializer/binary-serialization-format/Serializer.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cluster/cluster.bif b/src/cluster/cluster.bif index 011e53b245..927f129bc0 100644 --- a/src/cluster/cluster.bif +++ b/src/cluster/cluster.bif @@ -1,5 +1,6 @@ %%{ #include +#include #include "zeek/IPAddr.h" #include "zeek/cluster/Backend.h" @@ -218,7 +219,7 @@ function Cluster::__listen_websocket%(options: WebSocketServerOptions%): bool } struct ServerOptions server_options{ - listen_addr, + std::move(listen_addr), static_cast(options_rec->GetField("listen_port")->Port()), }; diff --git a/src/cluster/serializer/binary-serialization-format/Serializer.cc b/src/cluster/serializer/binary-serialization-format/Serializer.cc index 2540ff31ac..888b4bdf22 100644 --- a/src/cluster/serializer/binary-serialization-format/Serializer.cc +++ b/src/cluster/serializer/binary-serialization-format/Serializer.cc @@ -134,7 +134,7 @@ std::optional detail::BinarySerializationF fmt.EndRead(); - return logging::detail::LogWriteBatch{header, std::move(records)}; + return logging::detail::LogWriteBatch{std::move(header), std::move(records)}; } #include "zeek/ID.h"