소스 검색

Kernel: Use move to avoid unnecessary ref/unref of network device RefPtr

Flagged by pvs-studio as a potential perf optimization.
Brian Gianforcaro 3 년 전
부모
커밋
4fe99ff0d6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Kernel/Net/Socket.cpp

+ 1 - 1
Kernel/Net/Socket.cpp

@@ -101,7 +101,7 @@ KResult Socket::setsockopt(int level, int option, Userspace<const void*> 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: