Просмотр исходного кода

input_common/udp: std::move shared_ptr within Client constructor

Gets rid of a trivially avoidable atomic reference count increment and
decrement.
Lioncash 6 лет назад
Родитель
Сommit
fb9c9ddcc9
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/input_common/udp/client.cpp

+ 1 - 1
src/input_common/udp/client.cpp

@@ -125,7 +125,7 @@ static void SocketLoop(Socket* socket) {
 
 Client::Client(std::shared_ptr<DeviceStatus> status, const std::string& host, u16 port,
                u8 pad_index, u32 client_id)
-    : status(status) {
+    : status(std::move(status)) {
     StartCommunication(host, port, pad_index, client_id);
 }