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
82b53c65
Commit
82b53c65
authored
Mar 20, 2014
by
antirez
Browse files
struct dictEntry -> dictEntry.
parent
5317f5e9
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
82b53c65
...
@@ -685,7 +685,7 @@ void clusterDelNode(clusterNode *delnode) {
...
@@ -685,7 +685,7 @@ void clusterDelNode(clusterNode *delnode) {
/* Node lookup by name */
/* Node lookup by name */
clusterNode
*
clusterLookupNode
(
char
*
name
)
{
clusterNode
*
clusterLookupNode
(
char
*
name
)
{
sds
s
=
sdsnewlen
(
name
,
REDIS_CLUSTER_NAMELEN
);
sds
s
=
sdsnewlen
(
name
,
REDIS_CLUSTER_NAMELEN
);
struct
dictEntry
*
de
;
dictEntry
*
de
;
de
=
dictFind
(
server
.
cluster
->
nodes
,
s
);
de
=
dictFind
(
server
.
cluster
->
nodes
,
s
);
sdsfree
(
s
);
sdsfree
(
s
);
...
@@ -1770,7 +1770,7 @@ void clusterSendPing(clusterLink *link, int type) {
...
@@ -1770,7 +1770,7 @@ void clusterSendPing(clusterLink *link, int type) {
/* Populate the gossip fields */
/* Populate the gossip fields */
while
(
freshnodes
>
0
&&
gossipcount
<
3
)
{
while
(
freshnodes
>
0
&&
gossipcount
<
3
)
{
struct
dictEntry
*
de
=
dictGetRandomKey
(
server
.
cluster
->
nodes
);
dictEntry
*
de
=
dictGetRandomKey
(
server
.
cluster
->
nodes
);
clusterNode
*
this
=
dictGetVal
(
de
);
clusterNode
*
this
=
dictGetVal
(
de
);
clusterMsgDataGossip
*
gossip
;
clusterMsgDataGossip
*
gossip
;
int
j
;
int
j
;
...
...
src/db.c
View file @
82b53c65
...
@@ -104,7 +104,7 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
...
@@ -104,7 +104,7 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
*
*
* The program is aborted if the key was not already present. */
* The program is aborted if the key was not already present. */
void
dbOverwrite
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
)
{
void
dbOverwrite
(
redisDb
*
db
,
robj
*
key
,
robj
*
val
)
{
struct
dictEntry
*
de
=
dictFind
(
db
->
dict
,
key
->
ptr
);
dictEntry
*
de
=
dictFind
(
db
->
dict
,
key
->
ptr
);
redisAssertWithInfo
(
NULL
,
key
,
de
!=
NULL
);
redisAssertWithInfo
(
NULL
,
key
,
de
!=
NULL
);
dictReplace
(
db
->
dict
,
key
->
ptr
,
val
);
dictReplace
(
db
->
dict
,
key
->
ptr
,
val
);
...
@@ -136,7 +136,7 @@ int dbExists(redisDb *db, robj *key) {
...
@@ -136,7 +136,7 @@ int dbExists(redisDb *db, robj *key) {
*
*
* The function makes sure to return keys not already expired. */
* The function makes sure to return keys not already expired. */
robj
*
dbRandomKey
(
redisDb
*
db
)
{
robj
*
dbRandomKey
(
redisDb
*
db
)
{
struct
dictEntry
*
de
;
dictEntry
*
de
;
while
(
1
)
{
while
(
1
)
{
sds
key
;
sds
key
;
...
...
src/pubsub.c
View file @
82b53c65
...
@@ -50,7 +50,7 @@ int listMatchPubsubPattern(void *a, void *b) {
...
@@ -50,7 +50,7 @@ int listMatchPubsubPattern(void *a, void *b) {
/* Subscribe a client to a channel. Returns 1 if the operation succeeded, or
/* Subscribe a client to a channel. Returns 1 if the operation succeeded, or
* 0 if the client was already subscribed to that channel. */
* 0 if the client was already subscribed to that channel. */
int
pubsubSubscribeChannel
(
redisClient
*
c
,
robj
*
channel
)
{
int
pubsubSubscribeChannel
(
redisClient
*
c
,
robj
*
channel
)
{
struct
dictEntry
*
de
;
dictEntry
*
de
;
list
*
clients
=
NULL
;
list
*
clients
=
NULL
;
int
retval
=
0
;
int
retval
=
0
;
...
@@ -80,7 +80,7 @@ int pubsubSubscribeChannel(redisClient *c, robj *channel) {
...
@@ -80,7 +80,7 @@ int pubsubSubscribeChannel(redisClient *c, robj *channel) {
/* Unsubscribe a client from a channel. Returns 1 if the operation succeeded, or
/* Unsubscribe a client from a channel. Returns 1 if the operation succeeded, or
* 0 if the client was not subscribed to the specified channel. */
* 0 if the client was not subscribed to the specified channel. */
int
pubsubUnsubscribeChannel
(
redisClient
*
c
,
robj
*
channel
,
int
notify
)
{
int
pubsubUnsubscribeChannel
(
redisClient
*
c
,
robj
*
channel
,
int
notify
)
{
struct
dictEntry
*
de
;
dictEntry
*
de
;
list
*
clients
;
list
*
clients
;
listNode
*
ln
;
listNode
*
ln
;
int
retval
=
0
;
int
retval
=
0
;
...
@@ -218,7 +218,7 @@ int pubsubUnsubscribeAllPatterns(redisClient *c, int notify) {
...
@@ -218,7 +218,7 @@ int pubsubUnsubscribeAllPatterns(redisClient *c, int notify) {
/* Publish a message */
/* Publish a message */
int
pubsubPublishMessage
(
robj
*
channel
,
robj
*
message
)
{
int
pubsubPublishMessage
(
robj
*
channel
,
robj
*
message
)
{
int
receivers
=
0
;
int
receivers
=
0
;
struct
dictEntry
*
de
;
dictEntry
*
de
;
listNode
*
ln
;
listNode
*
ln
;
listIter
li
;
listIter
li
;
...
...
src/redis.c
View file @
82b53c65
...
@@ -688,7 +688,7 @@ void updateDictResizePolicy(void) {
...
@@ -688,7 +688,7 @@ void updateDictResizePolicy(void) {
*
*
* The parameter 'now' is the current time in milliseconds as is passed
* The parameter 'now' is the current time in milliseconds as is passed
* to the function to avoid too many gettimeofday() syscalls. */
* to the function to avoid too many gettimeofday() syscalls. */
int
activeExpireCycleTryExpire
(
redisDb
*
db
,
struct
dictEntry
*
de
,
long
long
now
)
{
int
activeExpireCycleTryExpire
(
redisDb
*
db
,
dictEntry
*
de
,
long
long
now
)
{
long
long
t
=
dictGetSignedIntegerVal
(
de
);
long
long
t
=
dictGetSignedIntegerVal
(
de
);
if
(
now
>
t
)
{
if
(
now
>
t
)
{
sds
key
=
dictGetKey
(
de
);
sds
key
=
dictGetKey
(
de
);
...
@@ -2852,7 +2852,7 @@ void evictionPoolPopulate(dict *sampledict, dict *keydict, struct evictionPoolEn
...
@@ -2852,7 +2852,7 @@ void evictionPoolPopulate(dict *sampledict, dict *keydict, struct evictionPoolEn
unsigned
long
long
idle
;
unsigned
long
long
idle
;
sds
key
;
sds
key
;
robj
*
o
;
robj
*
o
;
struct
dictEntry
*
de
;
dictEntry
*
de
;
de
=
dictGetRandomKey
(
sampledict
);
de
=
dictGetRandomKey
(
sampledict
);
key
=
dictGetKey
(
de
);
key
=
dictGetKey
(
de
);
...
@@ -2939,7 +2939,7 @@ int freeMemoryIfNeeded(void) {
...
@@ -2939,7 +2939,7 @@ int freeMemoryIfNeeded(void) {
for
(
j
=
0
;
j
<
server
.
dbnum
;
j
++
)
{
for
(
j
=
0
;
j
<
server
.
dbnum
;
j
++
)
{
long
bestval
=
0
;
/* just to prevent warning */
long
bestval
=
0
;
/* just to prevent warning */
sds
bestkey
=
NULL
;
sds
bestkey
=
NULL
;
struct
dictEntry
*
de
;
dictEntry
*
de
;
redisDb
*
db
=
server
.
db
+
j
;
redisDb
*
db
=
server
.
db
+
j
;
dict
*
dict
;
dict
*
dict
;
...
...
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