Skip to content

Commit ec7aa4e

Browse files
committed
add clearification on remove duplicate code. may remove the comment later
1 parent 4383018 commit ec7aa4e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cpp/src/arrow/util/key_value_metadata.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ Status KeyValueMetadata::DeleteMany(std::vector<int64_t> indices) {
122122
"of size ",
123123
size);
124124
}
125+
// Remove duplicate indices, otherwise the shifting logic below would move entries
126+
// to incorrect (potentially negative) positions
125127
indices.erase(std::unique(indices.begin(), indices.end()), indices.end());
126128
indices.push_back(size);
127129

0 commit comments

Comments
 (0)