Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
8f9958dc
Unverified
Commit
8f9958dc
authored
Feb 09, 2021
by
Huang Zw
Committed by
GitHub
Feb 08, 2021
Browse files
Fix typo and some out of date comments (#8449)
Fix typo and some out of date comments
parent
dbcc0a85
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
8f9958dc
...
...
@@ -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
;
...
...
src/defrag.c
View file @
8f9958dc
...
...
@@ -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
scanLaterStr
a
emListpacks
(
robj
*
ob
,
unsigned
long
*
cursor
,
long
long
endtime
,
long
long
*
defragged
)
{
int
scanLaterStre
a
mListpacks
(
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
scanLaterStr
a
emListpacks
(
ob
,
cursor
,
endtime
,
&
server
.
stat_active_defrag_hits
);
return
scanLaterStre
a
mListpacks
(
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
{
...
...
src/evict.c
View file @
8f9958dc
...
...
@@ -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
small
er than one of the current
* expire a key. Keys with idle time
bigg
er 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
...
...
src/expire.c
View file @
8f9958dc
...
...
@@ -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
;
/*
Las
t DB test
ed
. */
static
unsigned
int
current_db
=
0
;
/*
Nex
t 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. */
...
...
src/quicklist.c
View file @
8f9958dc
...
...
@@ -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: bookma
k
rk 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
)
{
...
...
src/rdb.h
View file @
8f9958dc
...
...
@@ -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 b
ye
s, 6 bits + 8 bits of next byte
* 01|XXXXXX XXXXXXXX => 01, the len is 14 b
it
s, 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
...
...
src/t_string.c
View file @
8f9958dc
...
...
@@ -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 calli
g
n getDecodedObject(). */
* only after callin
g
getDecodedObject(). */
obja
=
NULL
;
objb
=
NULL
;
goto
cleanup
;
...
...
src/tls.c
View file @
8f9958dc
...
...
@@ -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 even
t
.
* 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment