mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
[lldb][NFC] Use llvm::is_contained instead of std::find in a few places
This commit is contained in:
@@ -241,15 +241,12 @@ bool Breakpoint::SerializedBreakpointMatchesNames(
|
||||
return false;
|
||||
|
||||
size_t num_names = names_array->GetSize();
|
||||
std::vector<std::string>::iterator begin = names.begin();
|
||||
std::vector<std::string>::iterator end = names.end();
|
||||
|
||||
for (size_t i = 0; i < num_names; i++) {
|
||||
llvm::StringRef name;
|
||||
if (names_array->GetItemAtIndexAsString(i, name)) {
|
||||
if (std::find(begin, end, name) != end) {
|
||||
if (llvm::is_contained(names, name))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1982,8 +1982,7 @@ public:
|
||||
protected:
|
||||
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override {
|
||||
// If we have already handled this from a -t option, skip it here.
|
||||
if (std::find(m_options.m_tids.begin(), m_options.m_tids.end(), tid) !=
|
||||
m_options.m_tids.end())
|
||||
if (llvm::is_contained(m_options.m_tids, tid))
|
||||
return true;
|
||||
|
||||
Process *process = m_exe_ctx.GetProcessPtr();
|
||||
|
||||
@@ -298,8 +298,7 @@ Status NativeProcessProtocol::RemoveHardwareBreakpoint(lldb::addr_t addr) {
|
||||
bool NativeProcessProtocol::RegisterNativeDelegate(
|
||||
NativeDelegate &native_delegate) {
|
||||
std::lock_guard<std::recursive_mutex> guard(m_delegates_mutex);
|
||||
if (std::find(m_delegates.begin(), m_delegates.end(), &native_delegate) !=
|
||||
m_delegates.end())
|
||||
if (llvm::is_contained(m_delegates, &native_delegate))
|
||||
return false;
|
||||
|
||||
m_delegates.push_back(&native_delegate);
|
||||
|
||||
@@ -315,7 +315,7 @@ uint32_t LineTable::FindLineEntryIndexByFileIndex(
|
||||
if (m_entries[idx].is_terminal_entry)
|
||||
continue;
|
||||
|
||||
if (llvm::find(file_indexes, m_entries[idx].file_idx) == file_indexes.end())
|
||||
if (!llvm::is_contained(file_indexes, m_entries[idx].file_idx))
|
||||
continue;
|
||||
|
||||
// Exact match always wins. Otherwise try to find the closest line > the
|
||||
|
||||
Reference in New Issue
Block a user