mapleFU commented on code in PR #39397:
URL: https://github.com/apache/arrow/pull/39397#discussion_r1438627172
##########
cpp/src/parquet/column_reader.cc:
##########
@@ -1195,12 +1192,8 @@ int64_t TypedColumnReaderImpl<DType>::ReadBatchSpaced(
const bool has_spaced_values = HasSpacedValues(this->descr_);
int64_t null_count = 0;
if (!has_spaced_values) {
- int values_to_read = 0;
- for (int64_t i = 0; i < num_def_levels; ++i) {
- if (def_levels[i] == this->max_def_level_) {
- ++values_to_read;
- }
- }
+ int values_to_read =
+ std::count(def_levels, def_levels + num_def_levels,
this->max_def_level_);
total_values = this->ReadValues(values_to_read, values);
Review Comment:
I'm ok with this but maybe this does not optimize, because `values_to_read`
is a value here, the compiler might well optimize it ( since strict aliasing
cannot mixing int16_t* and int64_t*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]