github-actions[bot] commented on code in PR #24898:
URL: https://github.com/apache/doris/pull/24898#discussion_r1338090903


##########
be/src/util/jsonb_document.h:
##########
@@ -1297,16 +1297,22 @@ inline bool JsonbValue::contains(JsonbValue* rhs) const 
{
         return false;
     }
     case JsonbType::T_Array: {
-        if (rhs->isArray() && ((ArrayVal*)this)->numElem() == 
((ArrayVal*)rhs)->numElem() &&
-            ((ArrayVal*)this)->numPackedBytes() == 
((ArrayVal*)rhs)->numPackedBytes()) {
-            for (int i = 0; i < ((ArrayVal*)this)->numElem(); ++i) {
-                if 
(!((ArrayVal*)this)->get(i)->contains(((ArrayVal*)rhs)->get(i))) {
-                    return false;
+        int lhs_num = ((ArrayVal*)this)->numElem();
+        if (rhs->isArray()) {
+            int rhs_num = ((ArrayVal*)rhs)->numElem();
+            if (rhs_num > lhs_num) return false;

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
               if (rhs_num > lhs_num) { return false;
   }
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to