From 008f56713efe51865b37827b74d63c29d7a285c3 Mon Sep 17 00:00:00 2001 From: alexstocks Date: Fri, 26 May 2023 18:09:13 +0800 Subject: [PATCH] format codes --- src/pika_admin.cc | 2 +- src/pika_bit.cc | 6 +++--- src/pika_geohash_helper.cc | 20 ++++++++++++-------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/pika_admin.cc b/src/pika_admin.cc index 4152bda276..f8ac27a637 100644 --- a/src/pika_admin.cc +++ b/src/pika_admin.cc @@ -1098,7 +1098,7 @@ void InfoCmd::InfoKeyspace(std::string& info) { if (rescan_) { g_pika_server->DoSameThingSpecificTable(TaskType::kStartKeyScan, keyspace_scan_tables_); } - } +} void InfoCmd::InfoData(std::string& info) { std::stringstream tmp_stream; diff --git a/src/pika_bit.cc b/src/pika_bit.cc index dad664ee3a..b7b6f2cf3f 100644 --- a/src/pika_bit.cc +++ b/src/pika_bit.cc @@ -63,7 +63,7 @@ void BitGetCmd::DoInitial() { res_.SetRes(CmdRes::kInvalidBitOffsetInt); return; } - } +} void BitGetCmd::Do(std::shared_ptr partition) { int32_t bit_val = 0; @@ -96,7 +96,7 @@ void BitCountCmd::DoInitial() { } else { res_.SetRes(CmdRes::kSyntaxErr, kCmdNameBitCount); } - } +} void BitCountCmd::Do(std::shared_ptr partition) { int32_t count = 0; @@ -204,7 +204,7 @@ void BitOpCmd::DoInitial() { for (unsigned int i = 3; i <= argv_.size() - 1; i++) { src_keys_.emplace_back(argv_[i].data()); } - } +} void BitOpCmd::Do(std::shared_ptr partition) { int64_t result_length; diff --git a/src/pika_geohash_helper.cc b/src/pika_geohash_helper.cc index e7f861659b..e2f58725b9 100644 --- a/src/pika_geohash_helper.cc +++ b/src/pika_geohash_helper.cc @@ -166,14 +166,18 @@ GeoHashRadius geohashGetAreasByRadius(double longitude, double latitude, double geohashDecode(long_range, lat_range, neighbors.east, &east); geohashDecode(long_range, lat_range, neighbors.west, &west); - if (geohashGetDistance(longitude, latitude, longitude, north.latitude.max) < radius_meters) { decrease_step = 1; -} - if (geohashGetDistance(longitude, latitude, longitude, south.latitude.min) < radius_meters) { decrease_step = 1; -} - if (geohashGetDistance(longitude, latitude, east.longitude.max, latitude) < radius_meters) { decrease_step = 1; -} - if (geohashGetDistance(longitude, latitude, west.longitude.min, latitude) < radius_meters) { decrease_step = 1; -} + if (geohashGetDistance(longitude, latitude, longitude, north.latitude.max) < radius_meters) { + decrease_step = 1; + } + if (geohashGetDistance(longitude, latitude, longitude, south.latitude.min) < radius_meters) { + decrease_step = 1; + } + if (geohashGetDistance(longitude, latitude, east.longitude.max, latitude) < radius_meters) { + decrease_step = 1; + } + if (geohashGetDistance(longitude, latitude, west.longitude.min, latitude) < radius_meters) { + decrease_step = 1; + } } if (steps > 1 && (decrease_step != 0)) {