mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 01:55:08 +00:00
Prevent unnecessary conversion from StringRef to C-string [NFC]
There is an alternative method to GetConstCStringWithLength that takes a StringRef. GetConstCStringWithLength also calls this method in the end, so directly calling the StringRef saves us from a unnecessary conversion to a C-string. llvm-svn: 358357
This commit is contained in:
parent
065480daf2
commit
12886f04ea
@ -200,7 +200,7 @@ ConstString::ConstString(const char *cstr, size_t cstr_len)
|
||||
: m_string(StringPool().GetConstCStringWithLength(cstr, cstr_len)) {}
|
||||
|
||||
ConstString::ConstString(const llvm::StringRef &s)
|
||||
: m_string(StringPool().GetConstCStringWithLength(s.data(), s.size())) {}
|
||||
: m_string(StringPool().GetConstCStringWithStringRef(s)) {}
|
||||
|
||||
bool ConstString::operator<(ConstString rhs) const {
|
||||
if (m_string == rhs.m_string)
|
||||
|
Loading…
Reference in New Issue
Block a user