1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 10:44:58 +00:00

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

Flagged by pvs-studio as a potential perf optimization.
This commit is contained in:
Brian Gianforcaro 2021-09-15 23:55:14 -07:00 committed by Andreas Kling
parent 24207d3795
commit 4fe99ff0d6

View file

@ -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: