Skip to content

Commit 6953dc9

Browse files
ccotterMichael137
authored andcommitted
[lldb][NFC] Use move instead of copy
Summary: For functions that accept an rvalue reference type parameter, use move to avoid copying the parameter. These were found when implementing CppCoreGuideline F.18 in clang-tidy. Committed on behalf of ccotter (Chris Cotter) Reviewers: Michael137 Differential Revision: https://reviews.llvm.org/D142824
1 parent ecb3cd0 commit 6953dc9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ Status GDBRemoteCommunicationServerPlatform::LaunchProcess() {
559559
}
560560

561561
void GDBRemoteCommunicationServerPlatform::SetPortMap(PortMap &&port_map) {
562-
m_port_map = port_map;
562+
m_port_map = std::move(port_map);
563563
}
564564

565565
const FileSpec &GDBRemoteCommunicationServerPlatform::GetDomainSocketDir() {

lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ size_t IHTRLayer::GetLayerId() const { return m_layer_id; }
6969

7070
void HTRBlockLayer::AppendNewBlock(size_t block_id, HTRBlock &&block) {
7171
m_block_id_trace.emplace_back(block_id);
72-
m_block_defs.emplace(block_id, block);
72+
m_block_defs.emplace(block_id, std::move(block));
7373
}
7474

7575
void HTRBlockLayer::AppendRepeatedBlock(size_t block_id) {

lldb/source/Target/Process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ Status Process::Signal(int signal) {
33523352

33533353
void Process::SetUnixSignals(UnixSignalsSP &&signals_sp) {
33543354
assert(signals_sp && "null signals_sp");
3355-
m_unix_signals_sp = signals_sp;
3355+
m_unix_signals_sp = std::move(signals_sp);
33563356
}
33573357

33583358
const lldb::UnixSignalsSP &Process::GetUnixSignals() {

0 commit comments

Comments
 (0)