You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/12/03 19:05:33 UTC

[GitHub] [incubator-kvrocks] MaximSmolskiy commented on a diff in pull request #1156: Fix modernize-use-nullptr warning reported by clang-tidy

MaximSmolskiy commented on code in PR #1156:
URL: https://github.com/apache/incubator-kvrocks/pull/1156#discussion_r1038821050


##########
src/types/geohash.cc:
##########
@@ -166,7 +166,7 @@ void geohashGetCoordRange(GeoHashRange *long_range, GeoHashRange *lat_range) {
 int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range, double longitude, double latitude,
                   uint8_t step, GeoHashBits *hash) {
   /* Check basic arguments sanity. */
-  if (hash == NULL || step > 32 || step == 0 || RANGEPISZERO(lat_range) || RANGEPISZERO(long_range)) return 0;
+  if (hash == nullptr || step > 32 || step == 0 || RANGEPISZERO(lat_range) || RANGEPISZERO(long_range)) return 0;

Review Comment:
   Replaced



##########
src/types/geohash.cc:
##########
@@ -203,7 +203,7 @@ int geohashEncodeWGS84(double longitude, double latitude, uint8_t step, GeoHashB
 
 int geohashDecode(const GeoHashRange &long_range, const GeoHashRange &lat_range, const GeoHashBits &hash,
                   GeoHashArea *area) {
-  if (HASHISZERO(hash) || NULL == area || RANGEISZERO(lat_range) || RANGEISZERO(long_range)) {
+  if (HASHISZERO(hash) || nullptr == area || RANGEISZERO(lat_range) || RANGEISZERO(long_range)) {

Review Comment:
   Replaced



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org