HuaHuaY commented on code in PR #51310:
URL: https://github.com/apache/arrow/pull/51310#discussion_r4013307780
##########
cpp/src/arrow/util/bit_run_reader.h:
##########
@@ -466,6 +468,386 @@ inline uint64_t
BaseSetBitRunReader<true>::ConsumeBits(uint64_t word, int32_t nu
using SetBitRunReader = BaseSetBitRunReader</*Reverse=*/false>;
using ReverseSetBitRunReader = BaseSetBitRunReader</*Reverse=*/true>;
+struct PositionedBitRun {
+ int64_t position;
+ int64_t length;
+ bool set;
+
+ std::string ToString() const {
+ return std::string("{pos=") + std::to_string(position) +
+ ", len=" + std::to_string(length) + ", set=" + std::to_string(set)
+ "}";
+ }
+};
+
+inline bool operator==(const PositionedBitRun& lhs, const PositionedBitRun&
rhs) {
Review Comment:
I think we can add `bool operator==(const PositionedBitRun&) const =
default;` in the struct definition, and we don't need to add the two functions.
(I am not sure if the `= default` syntax is supported by all CI compilers. At
least, I think that once we define `operator==`, we no longer need
`operator!=`.)
--
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]