Skip to content

Commit 7ce93f8

Browse files
committed
Add a few auto's and note the detached stack has no nullptr's.
1 parent 0f9c8a4 commit 7ce93f8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lldb/include/lldb/Target/ThreadPlanStack.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ class ThreadPlanStackMap {
149149
ThreadPlanStack *removed_stack = result->second;
150150
m_plans_list.erase(result);
151151
// Now find it in the stack storage:
152-
PlansStore::iterator end = m_plans_up_container.end();
153-
PlansStore::iterator iter = std::find_if(m_plans_up_container.begin(), end,
152+
auto end = m_plans_up_container.end();
153+
auto iter = std::find_if(m_plans_up_container.begin(), end,
154154
[&] (std::unique_ptr<ThreadPlanStack> &stack) {
155155
return stack->IsTID(tid);
156156
});
@@ -184,9 +184,8 @@ class ThreadPlanStackMap {
184184
// rename to Reactivate?
185185
void Activate(ThreadPlanStack &stack) {
186186
// Remove this from the detached plan list:
187-
std::vector<ThreadPlanStack *>::iterator end = m_detached_plans.end();
188-
std::vector<ThreadPlanStack *>::iterator iter
189-
= std::find_if(m_detached_plans.begin(), end,
187+
auto end = m_detached_plans.end();
188+
auto iter = std::find_if(m_detached_plans.begin(), end,
190189
[&] (ThreadPlanStack *elem) {
191190
return elem == &stack; });
192191
if (iter != end)
@@ -212,6 +211,11 @@ class ThreadPlanStackMap {
212211
}
213212
}
214213

214+
// This gets the vector of pointers to thread plans that aren't
215+
// currently running on a thread. This is generally for thread
216+
// plans that represent asynchronous operations waiting to be
217+
// scheduled.
218+
// The vector will never have null ThreadPlanStacks in it.
215219
std::vector<ThreadPlanStack *> &GetDetachedPlanStacks() {
216220
return m_detached_plans;
217221
}

0 commit comments

Comments
 (0)