Skip to content

Commit

Permalink
docs: improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Oct 24, 2023
1 parent dfd9660 commit 8cd0757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions awkward-cpp/src/cpu-kernels/awkward_Index_nones_as_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ ERROR awkward_Index_nones_as_index(
T* toindex,
int64_t length) {
int64_t n_non_null = 0;
// Assuming that `toindex` comprises of contiguous integers, and is zero-based
// Assuming that `toindex` comprises of unique, contiguous integers (or -1), and is zero-based
// Compute the number of non-null values to determine our starting index
for (int64_t i = 0; i < length; i++) {
if (toindex[i] != -1) {
n_non_null++;
}
}
//
// Now set the null-value indices to by monotonically increasing and unique from the final index
for (int64_t i = 0; i < length; i++) {
toindex[i] == -1 ? toindex[i] = n_non_null++ : toindex[i];
}
Expand Down

0 comments on commit 8cd0757

Please sign in to comment.