================
@@ -398,13 +398,16 @@ ValueObject::GetChildAtIndexPath(llvm::ArrayRef<size_t>
idxs,
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
+
+ size_t current_index = 0;
for (size_t idx : idxs) {
root = root->GetChildAtIndex(idx);
if (!root) {
if (index_of_error)
- *index_of_error = idx;
+ *index_of_error = current_index;
return root;
}
+ current_index += 1;
----------------
PortalPete wrote:
Sure!
I had a hunch someone would point this one out, but I thought it'd be fun to
see who, if anyone, would.
You passed the test! 😂
Personally, I prefer `+= 1` because:
- Swift doesn't have the `++` operator.
- In my mind `+= 1` more explicitly communicates my intent.
- I've seen people get burned by the "post" part of a post-increment operator
too many times. 🙃
https://github.com/llvm/llvm-project/pull/74413
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits