summaryrefslogtreecommitdiff
path: root/lldb/source/Symbol/ClangASTContext.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-21 22:46:10 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-21 22:46:10 +0000
commit8bb1c06ab3b46b1f95d5a946789b8edac8007403 (patch)
tree115249f4eef87bfbbfe45e40599538fe379fecf8 /lldb/source/Symbol/ClangASTContext.cpp
parentb61673d63b5e0e6bbe3f8463c33286f17f7d85b8 (diff)
[NFC] Replace `compare` with (in)equality operator where applicable.
Using compare is verbose, bug prone and potentially inefficient (because of early termination). Replace relevant call sites with the (in)equality operator.
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 0fb4699ac35..5052f3c2a44 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -7452,7 +7452,7 @@ ClangASTContext::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
base_class->getType());
std::string base_class_type_name(
base_class_clang_type.GetTypeName().AsCString(""));
- if (base_class_type_name.compare(name) == 0)
+ if (base_class_type_name == name)
return child_idx;
++child_idx;
}