================
@@ -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:

I take it you're referring to [Swift evolution's proposal 0004 - Remove the 
`++` and `--` 
operators](https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md).

As a coding and computer science mentor and writer, I naturally agree with 
Chris Lattner in that any code I write may serves as potential educational 
material to the reader/maintainer. For me, there are more cons than pros to the 
pre- and post-increment operators when I look at them through an educational 
lens.

https://github.com/llvm/llvm-project/pull/74413
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to