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
14629278
Unverified
Commit
14629278
authored
Sep 07, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Sep 07, 2018
Browse files
Merge pull request #5307 from mesbahamin/use_geohash_defines_in_check
Use geohash limit defines in constraint check
parents
83b8eaa6
a036c64c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/geohash.c
View file @
14629278
...
@@ -127,8 +127,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range,
...
@@ -127,8 +127,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range,
/* Return an error when trying to index outside the supported
/* Return an error when trying to index outside the supported
* constraints. */
* constraints. */
if
(
longitude
>
180
||
longitude
<
-
180
||
if
(
longitude
>
GEO_LONG_MAX
||
longitude
<
GEO_LONG_MIN
||
latitude
>
85
.
05112
878
||
latitude
<
-
85
.
05112
878
)
return
0
;
latitude
>
GEO_LAT_MAX
||
latitude
<
GEO_LAT_MIN
)
return
0
;
hash
->
bits
=
0
;
hash
->
bits
=
0
;
hash
->
step
=
step
;
hash
->
step
=
step
;
...
...
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