Merge "profiling/memory: tiny fixups of a couple of copy/move aspects."
diff --git a/src/profiling/memory/heapprofd_producer.cc b/src/profiling/memory/heapprofd_producer.cc
index 912c8c1..1252b99 100644
--- a/src/profiling/memory/heapprofd_producer.cc
+++ b/src/profiling/memory/heapprofd_producer.cc
@@ -44,7 +44,7 @@
return client_config;
}
-void FindPidsForBinaries(std::vector<std::string> binaries,
+void FindPidsForBinaries(const std::vector<std::string>& binaries,
std::vector<pid_t>* pids) {
base::ScopedDir proc_dir(opendir("/proc"));
if (!proc_dir) {
diff --git a/src/profiling/memory/string_interner.cc b/src/profiling/memory/string_interner.cc
index 088820d..f913fcf 100644
--- a/src/profiling/memory/string_interner.cc
+++ b/src/profiling/memory/string_interner.cc
@@ -20,7 +20,7 @@
namespace profiling {
StringInterner::Entry::Entry(std::string s, StringInterner* in)
- : string(s), interner(in) {}
+ : string(std::move(s)), interner(in) {}
bool StringInterner::Entry::operator<(const Entry& other) const {
return string < other.string;
@@ -54,7 +54,7 @@
entry_->ref_count++;
}
-StringInterner::InternedString::InternedString(InternedString&& other)
+StringInterner::InternedString::InternedString(InternedString&& other) noexcept
: entry_(other.entry_) {
other.entry_ = nullptr;
}
diff --git a/src/profiling/memory/string_interner.h b/src/profiling/memory/string_interner.h
index 660d0fc..29f0c22 100644
--- a/src/profiling/memory/string_interner.h
+++ b/src/profiling/memory/string_interner.h
@@ -41,7 +41,7 @@
friend class StringInterner;
InternedString(StringInterner::Entry* str);
InternedString(const InternedString& other);
- InternedString(InternedString&& other);
+ InternedString(InternedString&& other) noexcept;
InternedString& operator=(InternedString other);
const std::string& str() const;