================
@@ -414,13 +417,17 @@ lldb::ValueObjectSP ValueObject::GetChildAtIndexPath(
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
+
+ size_t current_index = 0;
for (std::pair<size_t, bool> idx : idxs) {
root = root->GetChildAtIndex(idx.first, idx.second);
if (!root) {
if (index_of_error)
- *index_of_error = idx.first;
+ *index_of_error = current_index;
return root;
}
+
+ current_index += 1;
----------------
PortalPete wrote:
I'm actually going to go with `++current_index` because that's what [the LLVM
coding style](https://llvm.org/docs/CodingStandards.html#prefer-preincrement)
recommends.
> Hard fast rule: Preincrement (++X) may be no slower than postincrement (X++)
> and could very well be a lot faster than it. Use preincrementation whenever
> possible.
>
> ...
https://github.com/llvm/llvm-project/pull/74413
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits