From 7e5e782041bab5c58ffbaaf50645cab3d985cfb7 Mon Sep 17 00:00:00 2001 From: Tessa Todorowski Date: Tue, 23 Jul 2024 10:16:38 +0200 Subject: [PATCH] remove std::move when opening an event --- src/perf/counter/group/reader.cpp | 10 ++++------ src/perf/counter/userspace/reader.cpp | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/perf/counter/group/reader.cpp b/src/perf/counter/group/reader.cpp index 857037d2..2fc40133 100644 --- a/src/perf/counter/group/reader.cpp +++ b/src/perf/counter/group/reader.cpp @@ -60,11 +60,11 @@ Reader::Reader(ExecutionScope scope, bool enable_on_exec) { if (scope.is_cpu()) { - counter_leader_ = std::move(counter_collection_.leader.open(scope.as_cpu())); + counter_leader_ = counter_collection_.leader.open(scope.as_cpu()); } else { - counter_leader_ = std::move(counter_collection_.leader.open(scope.as_thread())); + counter_leader_ = counter_collection_.leader.open(scope.as_thread()); } } catch (const std::system_error& e) @@ -101,13 +101,11 @@ Reader::Reader(ExecutionScope scope, bool enable_on_exec) { if (scope.is_cpu()) { - counter = - std::move(counter_ev.open(scope.as_cpu(), counter_leader_.get_fd())); + counter = counter_ev.open(scope.as_cpu(), counter_leader_.get_fd()); } else { - counter = - std::move(counter_ev.open(scope.as_thread(), counter_leader_.get_fd())); + counter = counter_ev.open(scope.as_thread(), counter_leader_.get_fd()); } } catch (const std::system_error& e) diff --git a/src/perf/counter/userspace/reader.cpp b/src/perf/counter/userspace/reader.cpp index 4a242083..e53d2375 100644 --- a/src/perf/counter/userspace/reader.cpp +++ b/src/perf/counter/userspace/reader.cpp @@ -90,11 +90,11 @@ Reader::Reader(ExecutionScope scope) if (scope.is_cpu()) { - counter = std::move(event.open(scope.as_cpu())); + counter = event.open(scope.as_cpu()); } else { - counter = std::move(event.open(scope.as_thread())); + counter = event.open(scope.as_thread()); } }