The current implementation creates empty bitmaps for nonexistent source keys srckeys, which are then freed if necessary, since the API must be consistent with redis' native BITOP command.
Bitmap* bitmap;
if (srctype == REDISMODULE_KEYTYPE_EMPTY) {
// "non-existent keys [...] are considered as a stream of zero bytes up to the length of the longest string"
bitmap = bitmap_alloc();
should_free[i] = true;
}
else {
bitmap = RedisModule_ModuleTypeGetValue(srckey);
should_free[i] = false;
}
bitmaps[i] = bitmap;
The presence of a should_free variable is specially disturbing, so I think we need to come up with something better.
The current implementation creates empty bitmaps for nonexistent source keys
srckey
s, which are then freed if necessary, since the API must be consistent with redis' nativeBITOP
command.The presence of a
should_free
variable is specially disturbing, so I think we need to come up with something better.