• Wen Hui's avatar
    BITCOUNT: check for argument, before checking for key (#12394) · 45d33106
    Wen Hui authored
    Generally, In any command we first check for  the argument and then check if key exist.
    
    Some of the examples are
    
    ```
    127.0.0.1:6379> getrange no-key invalid1 invalid2
    (error) ERR value is not an integer or out of range
    127.0.0.1:6379> setbit no-key 1 invalid
    (error) ERR bit is not an integer or out of range
    127.0.0.1:6379> xrange no-key invalid1 invalid2
    (error) ERR Invalid stream ID specified as stream command argument
    ```
    
    **Before change** 
    ```
    bitcount no-key invalid1 invalid2
    0
    ```
    
    **After change**
    ```
    bitcount no-key invalid1 invalid2
    (error) ERR value is not an integer or out of range
    ```
    45d33106
bitops.c 46.6 KB