cambyzju commented on code in PR #35537:
URL: https://github.com/apache/doris/pull/35537#discussion_r1617102632


##########
be/src/util/block_compression.cpp:
##########
@@ -669,7 +669,7 @@ class SnappySlicesSource : public snappy::Source {
     // REQUIRES: Available() >= n
     void Skip(size_t n) override {
         _available -= n;

Review Comment:
   1. this function has requirement for the caller:  `// REQUIRES: Available() 
>= n`, if the caller can not make sure this, maybe the caller have some bug;
   2. After the change in this pr, `_available` may be corrupted;
   3. If we really want to make `Skip` safe, I think only add a check at the 
begin of the function is better:
    ```if (unlikely(_available < n)) { return; }```



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