ucasfl commented on code in PR #17218:
URL: https://github.com/apache/doris/pull/17218#discussion_r1119544486


##########
be/src/util/bitmap_value.h:
##########
@@ -1710,18 +1709,17 @@ class BitmapValue {
             }
         }
         case BITMAP: {
+            auto it = _bitmap.begin();
+            for (; it != _bitmap.end() && *it < range_start;) {
+                ++it;
+            }
+
             int64_t count = 0;
-            for (auto it = _bitmap.begin(); it != _bitmap.end(); ++it) {
-                if (*it < range_start) {
-                    continue;
-                }
-                if (*it < range_end) {
-                    ret_bitmap->add(*it);
-                    ++count;
-                } else {
-                    break;
-                }
+            for (; it != _bitmap.end() && *it < range_end; ++it) {
+                ret_bitmap->add(*it);
+                ++count;

Review Comment:
   Reducing branch statement for better vectorization.



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