[Lldb-commits] [lldb] 65a2d6d - [lldb] Use *{Set, Map}::contains (NFC)
Kazu Hirata via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 14 21:41:47 PDT 2023
Author: Kazu Hirata
Date: 2023-03-14T21:41:40-07:00
New Revision: 65a2d6d6904f0b06f0d0cfdfbfa67dbe6599f081
URL: https://github.com/llvm/llvm-project/commit/65a2d6d6904f0b06f0d0cfdfbfa67dbe6599f081
DIFF: https://github.com/llvm/llvm-project/commit/65a2d6d6904f0b06f0d0cfdfbfa67dbe6599f081.diff
LOG: [lldb] Use *{Set,Map}::contains (NFC)
Added:
Modified:
lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
index c084c3fbefc5d..2826b102625fe 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -113,7 +113,7 @@ class DeclContextOverride {
llvm::DenseMap<clang::Decl *, Backup> m_backups;
void OverrideOne(clang::Decl *decl) {
- if (m_backups.find(decl) != m_backups.end()) {
+ if (m_backups.contains(decl)) {
return;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
index cc3abfdfde394..527055024a768 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -212,7 +212,7 @@ class TokenVerifier {
/// Returns true iff the given expression body contained a token with the
/// given content.
bool hasToken(llvm::StringRef token) const {
- return m_tokens.find(token) != m_tokens.end();
+ return m_tokens.contains(token);
}
};
diff --git a/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp b/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
index 6b78ce5de697a..6e56e29f8c31c 100644
--- a/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
+++ b/lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
@@ -23,7 +23,7 @@
using namespace lldb_private;
bool ClangHighlighter::isKeyword(llvm::StringRef token) const {
- return keywords.find(token) != keywords.end();
+ return keywords.contains(token);
}
ClangHighlighter::ClangHighlighter() {
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 391ed99607f77..1f89db0cb5ca0 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -4556,7 +4556,7 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
// Count how many trie symbols we'll add to the symbol table
int trie_symbol_table_augment_count = 0;
for (auto &e : external_sym_trie_entries) {
- if (symbols_added.find(e.entry.address) == symbols_added.end())
+ if (!symbols_added.contains(e.entry.address))
trie_symbol_table_augment_count++;
}
@@ -4603,8 +4603,7 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
if (function_starts_count > 0) {
uint32_t num_synthetic_function_symbols = 0;
for (i = 0; i < function_starts_count; ++i) {
- if (symbols_added.find(function_starts.GetEntryRef(i).addr) ==
- symbols_added.end())
+ if (!symbols_added.contains(function_starts.GetEntryRef(i).addr))
++num_synthetic_function_symbols;
}
@@ -4616,7 +4615,7 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
for (i = 0; i < function_starts_count; ++i) {
const FunctionStarts::Entry *func_start_entry =
function_starts.GetEntryAtIndex(i);
- if (symbols_added.find(func_start_entry->addr) == symbols_added.end()) {
+ if (!symbols_added.contains(func_start_entry->addr)) {
addr_t symbol_file_addr = func_start_entry->addr;
uint32_t symbol_flags = 0;
if (func_start_entry->data)
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index b99e9ec82f126..075d4b042d2aa 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -1392,7 +1392,7 @@ bool SymbolFileNativePDB::ParseImportedModules(
void SymbolFileNativePDB::ParseInlineSite(PdbCompilandSymId id,
Address func_addr) {
lldb::user_id_t opaque_uid = toOpaqueUid(id);
- if (m_inline_sites.find(opaque_uid) != m_inline_sites.end())
+ if (m_inline_sites.contains(opaque_uid))
return;
addr_t func_base = func_addr.GetFileAddress();
More information about the lldb-commits
mailing list