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
710c05ac
Commit
710c05ac
authored
Jun 27, 2015
by
antirez
Browse files
Geo: remove useless variable. geoRadiusGeneric() top comment improved.
parent
fa9d62d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/geo.c
View file @
710c05ac
...
@@ -412,9 +412,9 @@ void geoAddCommand(redisClient *c) {
...
@@ -412,9 +412,9 @@ void geoAddCommand(redisClient *c) {
#define RADIUS_COORDS 1
#define RADIUS_COORDS 1
#define RADIUS_MEMBER 2
#define RADIUS_MEMBER 2
/* GEORADIUS key x y radius unit [WITHDIST] [WITHHASH] [WITHCOORD] [ASC|DESC]
* GEORADIUSBYMEMBER key member radius unit ... options ... */
static
void
geoRadiusGeneric
(
redisClient
*
c
,
int
type
)
{
static
void
geoRadiusGeneric
(
redisClient
*
c
,
int
type
)
{
/* type == cords: [cmd, key, long, lat, radius, units, [optionals]]
* type == member: [cmd, key, member, radius, units, [optionals]] */
robj
*
key
=
c
->
argv
[
1
];
robj
*
key
=
c
->
argv
[
1
];
/* Look up the requested zset */
/* Look up the requested zset */
...
@@ -451,7 +451,7 @@ static void geoRadiusGeneric(redisClient *c, int type) {
...
@@ -451,7 +451,7 @@ static void geoRadiusGeneric(redisClient *c, int type) {
}
}
/* Discover and populate all optional parameters. */
/* Discover and populate all optional parameters. */
int
withdist
=
0
,
withhash
=
0
,
withcoords
=
0
,
noproperties
=
0
;
int
withdist
=
0
,
withhash
=
0
,
withcoords
=
0
;
int
sort
=
SORT_NONE
;
int
sort
=
SORT_NONE
;
if
(
c
->
argc
>
base_args
)
{
if
(
c
->
argc
>
base_args
)
{
int
remaining
=
c
->
argc
-
base_args
;
int
remaining
=
c
->
argc
-
base_args
;
...
@@ -463,11 +463,7 @@ static void geoRadiusGeneric(redisClient *c, int type) {
...
@@ -463,11 +463,7 @@ static void geoRadiusGeneric(redisClient *c, int type) {
withhash
=
1
;
withhash
=
1
;
else
if
(
!
strncasecmp
(
arg
,
"withcoord"
,
9
))
else
if
(
!
strncasecmp
(
arg
,
"withcoord"
,
9
))
withcoords
=
1
;
withcoords
=
1
;
else
if
(
!
strncasecmp
(
arg
,
"noprop"
,
6
)
||
else
if
(
!
strncasecmp
(
arg
,
"asc"
,
3
))
!
strncasecmp
(
arg
,
"withoutprop"
,
11
))
noproperties
=
1
;
else
if
(
!
strncasecmp
(
arg
,
"asc"
,
3
)
||
!
strncasecmp
(
arg
,
"sort"
,
4
))
sort
=
SORT_ASC
;
sort
=
SORT_ASC
;
else
if
(
!
strncasecmp
(
arg
,
"desc"
,
4
))
else
if
(
!
strncasecmp
(
arg
,
"desc"
,
4
))
sort
=
SORT_DESC
;
sort
=
SORT_DESC
;
...
...
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