diff --git a/src/db.c b/src/db.c index 3871753dd..ed522401f 100644 --- a/src/db.c +++ b/src/db.c @@ -106,9 +106,8 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) { robj *val; if (expireIfNeeded(db,key) == 1) { - /* Key expired. If we are in the context of a master, expireIfNeeded() - * returns 0 only when the key does not exist at all, so it's safe - * to return NULL ASAP. */ + /* If we are in the context of a master, expireIfNeeded() returns 1 + * when the key is no longer valid, so we can return NULL ASAP. */ if (server.masterhost == NULL) goto keymiss; diff --git a/src/defrag.c b/src/defrag.c index db797711e..2b28d523d 100644 --- a/src/defrag.c +++ b/src/defrag.c @@ -638,7 +638,7 @@ int defragRaxNode(raxNode **noderef) { } /* returns 0 if no more work needs to be been done, and 1 if time is up and more work is needed. */ -int scanLaterStraemListpacks(robj *ob, unsigned long *cursor, long long endtime, long long *defragged) { +int scanLaterStreamListpacks(robj *ob, unsigned long *cursor, long long endtime, long long *defragged) { static unsigned char last[sizeof(streamID)]; raxIterator ri; long iterations = 0; @@ -958,7 +958,7 @@ int defragLaterItem(dictEntry *de, unsigned long *cursor, long long endtime) { } else if (ob->type == OBJ_HASH) { server.stat_active_defrag_hits += scanLaterHash(ob, cursor); } else if (ob->type == OBJ_STREAM) { - return scanLaterStraemListpacks(ob, cursor, endtime, &server.stat_active_defrag_hits); + return scanLaterStreamListpacks(ob, cursor, endtime, &server.stat_active_defrag_hits); } else if (ob->type == OBJ_MODULE) { return moduleLateDefrag(dictGetKey(de), ob, cursor, endtime, &server.stat_active_defrag_hits); } else { diff --git a/src/evict.c b/src/evict.c index 04513cd1a..d3cdaaa80 100644 --- a/src/evict.c +++ b/src/evict.c @@ -135,7 +135,7 @@ void evictionPoolAlloc(void) { /* This is an helper function for performEvictions(), it is used in order * to populate the evictionPool with a few entries every time we want to - * expire a key. Keys with idle time smaller than one of the current + * expire a key. Keys with idle time bigger than one of the current * keys are added. Keys are always added if there are free entries. * * We insert keys on place in ascending order, so keys with the smaller diff --git a/src/expire.c b/src/expire.c index f79510817..0ce34aea8 100644 --- a/src/expire.c +++ b/src/expire.c @@ -83,9 +83,8 @@ int activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) { * keys that can be removed from the keyspace. * * Every expire cycle tests multiple databases: the next call will start - * again from the next db, with the exception of exists for time limit: in that - * case we restart again from the last database we were processing. Anyway - * no more than CRON_DBS_PER_CALL databases are tested at every iteration. + * again from the next db. No more than CRON_DBS_PER_CALL databases are + * tested at every iteration. * * The function can perform more or less work, depending on the "type" * argument. It can execute a "fast cycle" or a "slow cycle". The slow @@ -141,7 +140,7 @@ void activeExpireCycle(int type) { /* This function has some global state in order to continue the work * incrementally across calls. */ - static unsigned int current_db = 0; /* Last DB tested. */ + static unsigned int current_db = 0; /* Next DB to test. */ static int timelimit_exit = 0; /* Time limit hit in previous call? */ static long long last_fast_cycle = 0; /* When last fast cycle ran. */ diff --git a/src/quicklist.c b/src/quicklist.c index 32871ac12..b2a406004 100644 --- a/src/quicklist.c +++ b/src/quicklist.c @@ -1427,7 +1427,7 @@ void quicklistPush(quicklist *quicklist, void *value, const size_t sz, * Returns 1 on success (creation of new bookmark or override of an existing one). * Returns 0 on failure (reached the maximum supported number of bookmarks). * NOTE: use short simple names, so that string compare on find is quick. - * NOTE: bookmakrk creation may re-allocate the quicklist, so the input pointer + * NOTE: bookmark creation may re-allocate the quicklist, so the input pointer may change and it's the caller responsibilty to update the reference. */ int quicklistBookmarkCreate(quicklist **ql_ref, const char *name, quicklistNode *node) { diff --git a/src/rdb.h b/src/rdb.h index f22fbecd1..00ed5297c 100644 --- a/src/rdb.h +++ b/src/rdb.h @@ -45,7 +45,7 @@ * the first byte to interpreter the length: * * 00|XXXXXX => if the two MSB are 00 the len is the 6 bits of this byte - * 01|XXXXXX XXXXXXXX => 01, the len is 14 byes, 6 bits + 8 bits of next byte + * 01|XXXXXX XXXXXXXX => 01, the len is 14 bits, 6 bits + 8 bits of next byte * 10|000000 [32 bit integer] => A full 32 bit len in net byte order will follow * 10|000001 [64 bit integer] => A full 64 bit len in net byte order will follow * 11|OBKIND this means: specially encoded object will follow. The six bits diff --git a/src/t_string.c b/src/t_string.c index de67484fc..d05366b7c 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -764,7 +764,7 @@ void stralgoLCS(client *c) { addReplyError(c, "The specified keys must contain string values"); /* Don't cleanup the objects, we need to do that - * only after callign getDecodedObject(). */ + * only after calling getDecodedObject(). */ obja = NULL; objb = NULL; goto cleanup; diff --git a/src/tls.c b/src/tls.c index 43c2f5551..bcfe53a35 100644 --- a/src/tls.c +++ b/src/tls.c @@ -350,7 +350,7 @@ ConnectionType CT_TLS; * socket operation. * * When this happens, we need to do two things: - * 1. Make sure we register for the even. + * 1. Make sure we register for the event. * 2. Make sure we know which handler needs to execute when the * event fires. That is, if we notify the caller of a write operation * that it blocks, and SSL asks for a read, we need to trigger the