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
76596198
Unverified
Commit
76596198
authored
Jun 12, 2018
by
球状闪电
Committed by
GitHub
Jun 12, 2018
Browse files
Update geohash.c
fix geohasEncode bug when step > 31
parent
94751543
Changes
1
Show whitespace changes
Inline
Side-by-side
src/geohash.c
View file @
76596198
...
@@ -144,8 +144,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range,
...
@@ -144,8 +144,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range,
(
longitude
-
long_range
->
min
)
/
(
long_range
->
max
-
long_range
->
min
);
(
longitude
-
long_range
->
min
)
/
(
long_range
->
max
-
long_range
->
min
);
/* convert to fixed point based on the step size */
/* convert to fixed point based on the step size */
lat_offset
*=
(
1
<<
step
);
lat_offset
*=
(
1
ULL
<<
step
);
long_offset
*=
(
1
<<
step
);
long_offset
*=
(
1
ULL
<<
step
);
hash
->
bits
=
interleave64
(
lat_offset
,
long_offset
);
hash
->
bits
=
interleave64
(
lat_offset
,
long_offset
);
return
1
;
return
1
;
}
}
...
...
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