• Binbin's avatar
    Adds limit to SINTERCARD/ZINTERCARD. (#9425) · f898a9e9
    Binbin authored
    Implements the [LIMIT limit] variant of SINTERCARD/ZINTERCARD.
    Now with the LIMIT, we can stop the searching when cardinality
    reaching the limit, and return the cardinality ASAP.
    
    Note that in SINTERCARD, the old synatx was: `SINTERCARD key [key ...]`
    In order to add a optional parameter, we must break the old synatx.
    So the new syntax of SINTERCARD will be consistent with ZINTERCARD.
    New syntax: `SINTERCARD numkeys key [key ...] [LIMIT limit]`.
    
    Note that this means that SINTERCARD has a different syntax than
    SINTER and SINTERSTORE (taking numkeys argument)
    
    As for ZINTERCARD, we can easily add a optional parameter to it.
    New syntax: `ZINTERCARD numkeys key [key ...] [LIMIT limit]`
    f898a9e9
t_set.c 42.4 KB