summaryrefslogtreecommitdiff
path: root/src/db.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-07-26 15:29:53 +0200
committerantirez <antirez@gmail.com>2015-07-26 15:29:53 +0200
commit2d9e3eb107b6b6289d5e3a51a32b3a018c96103c (patch)
tree379b4a8c2498a9be22d2f2b9ea3970669ebe42e5 /src/db.c
parent14ff572482cfe02c5ac61a1816cb8099d458e499 (diff)
downloadredis-2d9e3eb107b6b6289d5e3a51a32b3a018c96103c.tar.gz
RDMF: redisAssert -> serverAssert.
Diffstat (limited to 'src/db.c')
-rw-r--r--src/db.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/db.c b/src/db.c
index 55b725f78..72c4c3b4e 100644
--- a/src/db.c
+++ b/src/db.c
@@ -119,7 +119,7 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
sds copy = sdsdup(key->ptr);
int retval = dictAdd(db->dict, copy, val);
- redisAssertWithInfo(NULL,key,retval == REDIS_OK);
+ serverAssertWithInfo(NULL,key,retval == REDIS_OK);
if (val->type == OBJ_LIST) signalListAsReady(db, key);
if (server.cluster_enabled) slotToKeyAdd(key);
}
@@ -132,7 +132,7 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
void dbOverwrite(redisDb *db, robj *key, robj *val) {
dictEntry *de = dictFind(db->dict,key->ptr);
- redisAssertWithInfo(NULL,key,de != NULL);
+ serverAssertWithInfo(NULL,key,de != NULL);
dictReplace(db->dict, key->ptr, val);
}
@@ -224,7 +224,7 @@ int dbDelete(redisDb *db, robj *key) {
* using an sdscat() call to append some data, or anything else.
*/
robj *dbUnshareStringValue(redisDb *db, robj *key, robj *o) {
- redisAssert(o->type == OBJ_STRING);
+ serverAssert(o->type == OBJ_STRING);
if (o->refcount != 1 || o->encoding != OBJ_ENCODING_RAW) {
robj *decoded = getDecodedObject(o);
o = createRawStringObject(decoded->ptr, sdslen(decoded->ptr));
@@ -460,7 +460,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long cursor) {
/* Object must be NULL (to iterate keys names), or the type of the object
* must be Set, Sorted Set, or Hash. */
- redisAssert(o == NULL || o->type == OBJ_SET || o->type == OBJ_HASH ||
+ serverAssert(o == NULL || o->type == OBJ_SET || o->type == OBJ_HASH ||
o->type == OBJ_ZSET);
/* Set i to the first option argument. The previous one is the cursor. */
@@ -579,7 +579,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long cursor) {
char buf[REDIS_LONGSTR_SIZE];
int len;
- redisAssert(kobj->encoding == OBJ_ENCODING_INT);
+ serverAssert(kobj->encoding == OBJ_ENCODING_INT);
len = ll2string(buf,sizeof(buf),(long)kobj->ptr);
if (!stringmatchlen(pat, patlen, buf, len, 0)) filter = 1;
}
@@ -799,7 +799,7 @@ void moveCommand(client *c) {
int removeExpire(redisDb *db, robj *key) {
/* An expire may only be removed if there is a corresponding entry in the
* main dict. Otherwise, the key will never be freed. */
- redisAssertWithInfo(NULL,key,dictFind(db->dict,key->ptr) != NULL);
+ serverAssertWithInfo(NULL,key,dictFind(db->dict,key->ptr) != NULL);
return dictDelete(db->expires,key->ptr) == DICT_OK;
}
@@ -808,7 +808,7 @@ void setExpire(redisDb *db, robj *key, long long when) {
/* Reuse the sds from the main dict in the expire dict */
kde = dictFind(db->dict,key->ptr);
- redisAssertWithInfo(NULL,key,kde != NULL);
+ serverAssertWithInfo(NULL,key,kde != NULL);
de = dictReplaceRaw(db->expires,dictGetKey(kde));
dictSetSignedIntegerVal(de,when);
}
@@ -824,7 +824,7 @@ long long getExpire(redisDb *db, robj *key) {
/* The entry was found in the expire dict, this means it should also
* be present in the main dict (safety check). */
- redisAssertWithInfo(NULL,key,dictFind(db->dict,key->ptr) != NULL);
+ serverAssertWithInfo(NULL,key,dictFind(db->dict,key->ptr) != NULL);
return dictGetSignedIntegerVal(de);
}
@@ -924,7 +924,7 @@ void expireGenericCommand(client *c, long long basetime, int unit) {
if (when <= mstime() && !server.loading && !server.masterhost) {
robj *aux;
- redisAssertWithInfo(c,key,dbDelete(c->db,key));
+ serverAssertWithInfo(c,key,dbDelete(c->db,key));
server.dirty++;
/* Replicate/AOF this as an explicit DEL. */
@@ -1025,7 +1025,7 @@ int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, in
if (last < 0) last = argc+last;
keys = zmalloc(sizeof(int)*((last - cmd->firstkey)+1));
for (j = cmd->firstkey; j <= last; j += cmd->keystep) {
- redisAssert(j < argc);
+ serverAssert(j < argc);
keys[i++] = j;
}
*numkeys = i;