src/codec/memcomparable_format.h
/*
   Calculate the number of used bytes in the chunk and whether this is the
   last chunk in the input.  This is based on the new format - see
   pack_variable_format.
*/
Calculate the number of used bytes in the chunk and whether this is the
last chunk in the input.  This is based on the new format - see
pack_variable_format.
Calculate the number of used bytes in the chunk and whether this is the last chunk in the input . This is based on the new format - see pack_variable_format .
__attribute__((unused)) static uint32_t CalcUnpackVariableFormat(uchar flag, bool *done) {
    if (flag > RDB_ESCAPE_LENGTH) {
        return (uint32_t)-1;
    }
    if (flag < RDB_ESCAPE_LENGTH) {
        *done = true;
        return flag;
    }
    *done = false;
    return RDB_ESCAPE_LENGTH - 1;
}
__attribute__ ( ( unused ) ) static uint32_t CalcUnpackVariableFormat ( uchar flag , bool * done ) { if ( flag > RDB_ESCAPE_LENGTH ) { return ( uint32_t ) -1 ; } if ( flag < RDB_ESCAPE_LENGTH ) { * done = true ; return flag ; } * done = false ; return RDB_ESCAPE_LENGTH - 1 ; }
Calculate the number of used bytes in the chunk and whether this is the
last chunk in the input.
Calculate the number of used bytes in the chunk and whether this is the last chunk in the input .
// Check for invalid flag values // Values from 1 to N-1 indicate this is the last chunk and that is how // many bytes were used // A value of N means we used N-1 bytes and had more to go