wgtmac commented on code in PR #608:
URL: https://github.com/apache/iceberg-cpp/pull/608#discussion_r3014571028


##########
src/iceberg/deletes/roaring_position_bitmap.cc:
##########
@@ -128,8 +128,31 @@ void RoaringPositionBitmap::Add(int64_t pos) {
 }
 
 void RoaringPositionBitmap::AddRange(int64_t pos_start, int64_t pos_end) {
-  for (int64_t pos = pos_start; pos < pos_end; ++pos) {
-    Add(pos);
+  if (pos_start >= pos_end) {
+    return;
+  }
+  if (pos_start < 0 || pos_end - 1 > kMaxPosition) {

Review Comment:
   +1
   
   We need to ignore invalid positions but set values for valid ones.



##########
src/iceberg/deletes/roaring_position_bitmap.h:
##########
@@ -65,6 +65,7 @@ class ICEBERG_EXPORT RoaringPositionBitmap {
   void Add(int64_t pos);
 
   /// \brief Sets a range of positions [pos_start, pos_end).
+  /// If pos_start >= pos_end, this method does nothing.

Review Comment:
   This contradicts the note sentence below.



-- 
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]

Reply via email to