Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/spdlog/sinks/dist_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class dist_sink : public base_sink<Mutex> {
public:
dist_sink() = default;
explicit dist_sink(std::vector<std::shared_ptr<sink>> sinks)
: sinks_(sinks) {}
: sinks_(std::move(sinks)) {}
Comment on lines 26 to +27
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constructor parameter should be passed by value to enable the copy-and-swap idiom with std::move. However, for optimal flexibility, consider providing both const reference and rvalue reference overloads, or pass by const reference if move semantics are not intended. The current approach (pass-by-value + move) is valid but may not be the clearest API design without documentation explaining the ownership transfer semantics.

Copilot uses AI. Check for mistakes.

dist_sink(const dist_sink &) = delete;
dist_sink &operator=(const dist_sink &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion include/spdlog/sinks/udp_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ template <typename Mutex>
class udp_sink : public spdlog::sinks::base_sink<Mutex> {
public:
// host can be hostname or ip address
explicit udp_sink(udp_sink_config sink_config)
explicit udp_sink(const udp_sink_config& sink_config)
Copy link
Contributor Author

@KaganCanSit KaganCanSit Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change affects the API.

: client_{sink_config.server_host, sink_config.server_port} {}

~udp_sink() override = default;
Expand Down
Loading