[module] using predefined REDISMODULE_NO_EXPIRE in RM_GetExpire (#7669)

It was already defined in the API header and the documentation, but not used by the implementation.

(cherry picked from commit b7236f0002bcaa15f3a487def9c5069b6c422e65)
This commit is contained in:
Wen Hui 2020-08-18 01:50:03 -04:00 committed by Oran Agra
parent b091e0059d
commit 3e11f9d967

View File

@ -2100,7 +2100,8 @@ int RM_UnlinkKey(RedisModuleKey *key) {
* REDISMODULE_NO_EXPIRE is returned. */
mstime_t RM_GetExpire(RedisModuleKey *key) {
mstime_t expire = getExpire(key->db,key->key);
if (expire == -1 || key->value == NULL) return -1;
if (expire == -1 || key->value == NULL)
return REDISMODULE_NO_EXPIRE;
expire -= mstime();
return expire >= 0 ? expire : 0;
}