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
6eb52e20
Commit
6eb52e20
authored
Jul 08, 2019
by
Angus Pearson
Browse files
Change typeNameCanonicalize -> getObjectTypeName, and other style changes
parent
38cd5fd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
6eb52e20
...
...
@@ -767,7 +767,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long cursor) {
/* Filter an element if it isn't the type we want. */
if
(
!
filter
&&
o
==
NULL
&&
typename
){
robj
*
typecheck
=
lookupKeyReadWithFlags
(
c
->
db
,
kobj
,
LOOKUP_NOTOUCH
);
char
*
type
=
typeNameCanonicaliz
e
(
typecheck
);
char
*
type
=
getObjectTypeNam
e
(
typecheck
);
if
(
strcasecmp
((
char
*
)
typename
,
type
))
filter
=
1
;
}
...
...
@@ -827,7 +827,7 @@ void lastsaveCommand(client *c) {
addReplyLongLong
(
c
,
server
.
lastsave
);
}
char
*
typeNameCanonicaliz
e
(
robj
*
o
)
{
char
*
getObjectTypeNam
e
(
robj
*
o
)
{
char
*
type
;
if
(
o
==
NULL
)
{
type
=
"none"
;
...
...
@@ -852,7 +852,7 @@ char* typeNameCanonicalize(robj *o) {
void
typeCommand
(
client
*
c
)
{
robj
*
o
;
o
=
lookupKeyReadWithFlags
(
c
->
db
,
c
->
argv
[
1
],
LOOKUP_NOTOUCH
);
addReplyStatus
(
c
,
typeNameCanonicaliz
e
(
o
));
addReplyStatus
(
c
,
getObjectTypeNam
e
(
o
));
}
void
shutdownCommand
(
client
*
c
)
{
...
...
src/server.h
View file @
6eb52e20
...
...
@@ -646,11 +646,10 @@ typedef struct redisObject {
void
*
ptr
;
}
robj
;
/* The 'canonical' name for a type as enumerated above is given by the
* below function. Native types are checked against the OBJ_STRING,
* OBJ_LIST, OBJ_* defines, and Module types have their registered name
* returned.*/
char
*
typeNameCanonicalize
(
robj
*
);
/* The a string name for an object's type as listed above
* Native types are checked against the OBJ_STRING, OBJ_LIST, OBJ_* defines,
* and Module types have their registered name returned. */
char
*
getObjectTypeName
(
robj
*
);
/* Macro used to initialize a Redis object allocated on the stack.
* Note that this macro is taken near the structure definition to make sure
...
...
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