From 4fe99ff0d6ca680e19b9022fef4fa52590ca261c Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Wed, 15 Sep 2021 23:55:14 -0700 Subject: [PATCH] Kernel: Use move to avoid unnecessary ref/unref of network device RefPtr Flagged by pvs-studio as a potential perf optimization. --- Kernel/Net/Socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 89f7300713..85c358f3a2 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -101,7 +101,7 @@ KResult Socket::setsockopt(int level, int option, Userspace user_va auto device = NetworkingManagement::the().lookup_by_name(ifname->view()); if (!device) return ENODEV; - m_bound_interface = device; + m_bound_interface = move(device); return KSuccess; } case SO_KEEPALIVE: