Copilot commented on code in PR #60511:
URL: https://github.com/apache/doris/pull/60511#discussion_r2771978779
##########
be/src/olap/rowset/segment_v2/column_writer.cpp:
##########
@@ -79,7 +79,12 @@ class NullBitmapBuilder {
size_t raw_est = raw_bytes + raw_overhead + kReserveSlackBytes;
size_t reserve_bytes = std::min(raw_est, run_bytes_est);
if (_bitmap_buf.capacity() < reserve_bytes) {
- _bitmap_buf.reserve(reserve_bytes);
+ // _bitmap_buf.reserve(reserve_bytes);
+ size_t cap = _bitmap_buf.capacity();
+ size_t grow = cap + cap / 2;
+ size_t new_cap = std::max(reserve_bytes, grow);
+ new_cap = std::max(new_cap, reserve_bytes);
Review Comment:
Redundant calculation: line 85 already computes `new_cap =
std::max(reserve_bytes, grow)`, so line 86's `std::max(new_cap, reserve_bytes)`
is redundant since `new_cap` is already >= `reserve_bytes`. Line 86 should be
removed.
```suggestion
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]