Skip to content

Commit df4b453

Browse files
[lldb] Use llvm::find (NFC) (#143338)
This patch should be mostly obvious, but in one place, this patch changes: const auto &it = std::find(...) to: auto it = llvm::find(...) We do not need to bind to a temporary with const ref.
1 parent c6670fa commit df4b453

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

lldb/source/Breakpoint/WatchpointResource.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ void WatchpointResource::AddConstituent(const WatchpointSP &wp_sp) {
5656

5757
void WatchpointResource::RemoveConstituent(WatchpointSP &wp_sp) {
5858
std::lock_guard<std::mutex> guard(m_constituents_mutex);
59-
const auto &it =
60-
std::find(m_constituents.begin(), m_constituents.end(), wp_sp);
59+
auto it = llvm::find(m_constituents, wp_sp);
6160
if (it != m_constituents.end())
6261
m_constituents.erase(it);
6362
}

lldb/source/Expression/FunctionCaller.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,7 @@ bool FunctionCaller::FetchFunctionResults(ExecutionContext &exe_ctx,
323323
void FunctionCaller::DeallocateFunctionResults(ExecutionContext &exe_ctx,
324324
lldb::addr_t args_addr) {
325325
std::list<lldb::addr_t>::iterator pos;
326-
pos = std::find(m_wrapper_args_addrs.begin(), m_wrapper_args_addrs.end(),
327-
args_addr);
326+
pos = llvm::find(m_wrapper_args_addrs, args_addr);
328327
if (pos != m_wrapper_args_addrs.end())
329328
m_wrapper_args_addrs.erase(pos);
330329

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
17281728

17291729
reg_ctx_sp->InvalidateIfNeeded(true);
17301730

1731-
auto iter = std::find(m_thread_ids.begin(), m_thread_ids.end(), tid);
1731+
auto iter = llvm::find(m_thread_ids, tid);
17321732
if (iter != m_thread_ids.end())
17331733
SetThreadPc(thread_sp, iter - m_thread_ids.begin());
17341734

lldb/source/Target/Process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5838,7 +5838,7 @@ void Process::ClearPreResumeActions() { m_pre_resume_actions.clear(); }
58385838
void Process::ClearPreResumeAction(PreResumeActionCallback callback, void *baton)
58395839
{
58405840
PreResumeCallbackAndBaton element(callback, baton);
5841-
auto found_iter = std::find(m_pre_resume_actions.begin(), m_pre_resume_actions.end(), element);
5841+
auto found_iter = llvm::find(m_pre_resume_actions, element);
58425842
if (found_iter != m_pre_resume_actions.end())
58435843
{
58445844
m_pre_resume_actions.erase(found_iter);

0 commit comments

Comments
 (0)