[lldb] Eliminate unneeded value parameters in Utility (NFC)
Eliminates value parameter for types that are not trivially copyable.
This commit is contained in:
@@ -212,7 +212,7 @@ ConstString::ConstString(const char *cstr, size_t cstr_len)
|
||||
ConstString::ConstString(const llvm::StringRef &s)
|
||||
: m_string(StringPool().GetConstCStringWithStringRef(s)) {}
|
||||
|
||||
bool ConstString::operator<(ConstString rhs) const {
|
||||
bool ConstString::operator<(const ConstString &rhs) const {
|
||||
if (m_string == rhs.m_string)
|
||||
return false;
|
||||
|
||||
@@ -227,7 +227,7 @@ bool ConstString::operator<(ConstString rhs) const {
|
||||
return lhs_string_ref.data() == nullptr;
|
||||
}
|
||||
|
||||
Stream &lldb_private::operator<<(Stream &s, ConstString str) {
|
||||
Stream &lldb_private::operator<<(Stream &s, const ConstString &str) {
|
||||
const char *cstr = str.GetCString();
|
||||
if (cstr != nullptr)
|
||||
s << cstr;
|
||||
@@ -239,7 +239,7 @@ size_t ConstString::GetLength() const {
|
||||
return Pool::GetConstCStringLength(m_string);
|
||||
}
|
||||
|
||||
bool ConstString::Equals(ConstString lhs, ConstString rhs,
|
||||
bool ConstString::Equals(const ConstString &lhs, const ConstString &rhs,
|
||||
const bool case_sensitive) {
|
||||
if (lhs.m_string == rhs.m_string)
|
||||
return true;
|
||||
@@ -256,7 +256,7 @@ bool ConstString::Equals(ConstString lhs, ConstString rhs,
|
||||
return lhs_string_ref.equals_lower(rhs_string_ref);
|
||||
}
|
||||
|
||||
int ConstString::Compare(ConstString lhs, ConstString rhs,
|
||||
int ConstString::Compare(const ConstString &lhs, const ConstString &rhs,
|
||||
const bool case_sensitive) {
|
||||
// If the iterators are the same, this is the same string
|
||||
const char *lhs_cstr = lhs.m_string;
|
||||
@@ -308,7 +308,7 @@ void ConstString::SetString(const llvm::StringRef &s) {
|
||||
}
|
||||
|
||||
void ConstString::SetStringWithMangledCounterpart(llvm::StringRef demangled,
|
||||
ConstString mangled) {
|
||||
const ConstString &mangled) {
|
||||
m_string = StringPool().GetConstCStringAndSetMangledCounterPart(
|
||||
demangled, mangled.m_string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user