From 067f09b41d323c3b3080a5f9fea7305b423b5fdb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 24 Nov 2018 10:07:04 -0500 Subject: [PATCH] kernel/shared_memory: std::move the string parameter in SetName() This avoids a potential reallocation. --- src/core/hle/kernel/shared_memory.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index b8760ac4b3..a97630d2e4 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include "common/common_types.h" #include "core/hle/kernel/object.h" #include "core/hle/kernel/process.h" @@ -21,7 +22,7 @@ public: return name; } void SetName(std::string name) { - this->name = name; + this->name = std::move(name); } static const HandleType HANDLE_TYPE = HandleType::SharedMemory;