diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-03-06 21:22:25 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-03-06 21:22:25 +0000 |
commit | 0e4c482124f098957fc13bcfbabc36775dd190ab (patch) | |
tree | 34ee130b6d6de0d41a229021c4b46ab66b891a08 /lldb/source/Interpreter/OptionValueDictionary.cpp | |
parent | 480bce28ffc4640f443e262fa110af50b0d635df (diff) | |
download | bcm5719-llvm-0e4c482124f098957fc13bcfbabc36775dd190ab.tar.gz bcm5719-llvm-0e4c482124f098957fc13bcfbabc36775dd190ab.zip |
Pass ConstString by value (NFC)
My apologies for the large patch. With the exception of ConstString.h
itself it was entirely produced by sed.
ConstString has exactly one const char * data member, so passing a
ConstString by reference is not any more efficient than copying it by
value. In both cases a single pointer is passed. But passing it by
value makes it harder to accidentally return the address of a local
object.
(This fixes rdar://problem/48640859 for the Apple folks)
Differential Revision: https://reviews.llvm.org/D59030
llvm-svn: 355553
Diffstat (limited to 'lldb/source/Interpreter/OptionValueDictionary.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionValueDictionary.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp index 3268303ba0c..eb66c485bfd 100644 --- a/lldb/source/Interpreter/OptionValueDictionary.cpp +++ b/lldb/source/Interpreter/OptionValueDictionary.cpp @@ -276,7 +276,7 @@ Status OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx, } lldb::OptionValueSP -OptionValueDictionary::GetValueForKey(const ConstString &key) const { +OptionValueDictionary::GetValueForKey(ConstString key) const { lldb::OptionValueSP value_sp; collection::const_iterator pos = m_values.find(key); if (pos != m_values.end()) @@ -284,7 +284,7 @@ OptionValueDictionary::GetValueForKey(const ConstString &key) const { return value_sp; } -bool OptionValueDictionary::SetValueForKey(const ConstString &key, +bool OptionValueDictionary::SetValueForKey(ConstString key, const lldb::OptionValueSP &value_sp, bool can_replace) { // Make sure the value_sp object is allowed to contain values of the type @@ -301,7 +301,7 @@ bool OptionValueDictionary::SetValueForKey(const ConstString &key, return false; } -bool OptionValueDictionary::DeleteValueForKey(const ConstString &key) { +bool OptionValueDictionary::DeleteValueForKey(ConstString key) { collection::iterator pos = m_values.find(key); if (pos != m_values.end()) { m_values.erase(pos); |