zenoyang commented on a change in pull request #8787:
URL: https://github.com/apache/incubator-doris/pull/8787#discussion_r841025228



##########
File path: be/src/olap/comparison_predicate.cpp
##########
@@ -548,8 +547,7 @@ COMPARISON_PRED_SET_DICT_CODE(NotEqualPredicate)
                 auto& dict_col =                                               
                \
                         
reinterpret_cast<vectorized::ColumnDictionary<vectorized::Int32>&>(    \
                                 *col_ptr);                                     
                \
-                auto code = dict_col.find_code_by_bound(_value, 0 OP 1, 1 OP 
1);               \
-                _dict_code = code;                                             
                \
+                _dict_code = dict_col.find_code_by_bound(_value, 1 OP 0, 1 OP 
1);              \

Review comment:
       If `1 OP 0` returns true, it means the predicate is `>` or `>=`,
   If `1 OP 1` returns true, it means the predicate is `>=` or `<=`
   Through this trick, avoid redundant code, such as `bool is_greater = type() 
== PredicateType::GT || type() == PredicateType::GE;`
   ok, i will add a comment.




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