Commit 41fab4ec authored by Vitaly Arbuzov's avatar Vitaly Arbuzov
Browse files

Cleanup spacing

parent 57c98d27
......@@ -2252,13 +2252,13 @@ int rewriteAppendOnlyFileRio(rio *aof) {
for (j = 0; j < server.dbnum; j++) {
char selectcmd[] = "*2\r\n$6\r\nSELECT\r\n";
/* SELECT the new DB */
if (rioWrite(aof, selectcmd, sizeof(selectcmd) - 1) == 0) goto werr;
if (rioWriteBulkLongLong(aof, j) == 0) goto werr;
if (rioWrite(aof,selectcmd,sizeof(selectcmd)-1) == 0) goto werr;
if (rioWriteBulkLongLong(aof,j) == 0) goto werr;
redisDb *db = server.db + j;
dbIterator dbit;
dbIteratorInit(&dbit, db);
/* Iterate this DB writing every entry */
while ((de = dbIteratorNext(&dbit)) != NULL) {
while((de = dbIteratorNext(&dbit)) != NULL) {
sds keystr;
robj key, *o;
long long expiretime;
......
......@@ -876,10 +876,10 @@ void keysCommand(client *c) {
sds key = dictGetKey(de);
robj *keyobj;
if (allkeys || stringmatchlen(pattern, plen, key, sdslen(key), 0)) {
keyobj = createStringObject(key, sdslen(key));
if (!keyIsExpired(c->db, keyobj)) {
addReplyBulk(c, keyobj);
if (allkeys || stringmatchlen(pattern,plen,key,sdslen(key),0)) {
keyobj = createStringObject(key,sdslen(key));
if (!keyIsExpired(c->db,keyobj)) {
addReplyBulk(c,keyobj);
numkeys++;
}
decrRefCount(keyobj);
......@@ -1707,7 +1707,7 @@ void swapdbCommand(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. */
serverAssertWithInfo(NULL,key, dictFind(db->dict[getKeySlot(key->ptr)], key->ptr) != NULL);
serverAssertWithInfo(NULL,key,dictFind(db->dict[getKeySlot(key->ptr)], key->ptr) != NULL);
return dictDelete(db->expires,key->ptr) == DICT_OK;
}
......
......@@ -294,21 +294,21 @@ void computeDatasetDigest(unsigned char *final) {
mixDigest(final, &aux, sizeof(aux));
/* Iterate this DB writing every entry */
while ((de = dbIteratorNext(&dbit)) != NULL) {
while((de = dbIteratorNext(&dbit)) != NULL) {
sds key;
robj *keyobj, *o;
memset(digest, 0, 20); /* This key-val digest */
memset(digest,0,20); /* This key-val digest */
key = dictGetKey(de);
keyobj = createStringObject(key, sdslen(key));
keyobj = createStringObject(key,sdslen(key));
mixDigest(digest, key, sdslen(key));
mixDigest(digest,key,sdslen(key));
o = dictGetVal(de);
xorObjectDigest(db, keyobj, digest, o);
xorObjectDigest(db,keyobj,digest,o);
/* We can finally xor the key-val digest to the final digest */
xorDigest(final, digest, 20);
xorDigest(final,digest,20);
decrRefCount(keyobj);
}
}
......
......@@ -1159,7 +1159,7 @@ dictEntry *dictGetFairRandomKey(dict *d) {
/* Function to reverse bits. Algorithm from:
* http://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel */
unsigned long rev(unsigned long v) {
static unsigned long rev(unsigned long v) {
unsigned long s = CHAR_BIT * sizeof(v); // bit size; must be power of 2
unsigned long mask = ~0UL;
while ((s >>= 1) > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment