From 8bb1c06ab3b46b1f95d5a946789b8edac8007403 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 21 Dec 2018 22:46:10 +0000 Subject: [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. --- lldb/source/Symbol/ClangASTContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Symbol/ClangASTContext.cpp') 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; } -- cgit v1.2.3