@@ -78,7 +78,7 @@ void GeoPosCmd::DoInitial() {
7878}
7979
8080void GeoPosCmd::Do (std::shared_ptr<Slot> slot) {
81- double score;
81+ double score = 0.0 ;
8282 res_.AppendArrayLenUint64 (members_.size ());
8383 for (const auto & member : members_) {
8484 rocksdb::Status s = slot->db ()->ZScore (key_, member, &score);
@@ -153,8 +153,8 @@ void GeoDistCmd::DoInitial() {
153153}
154154
155155void GeoDistCmd::Do (std::shared_ptr<Slot> slot) {
156- double first_score;
157- double second_score;
156+ double first_score = 0.0 ;
157+ double second_score = 0.0 ;
158158 double first_xy[2 ];
159159 double second_xy[2 ];
160160 rocksdb::Status s = slot->db ()->ZScore (key_, first_pos_, &first_score);
@@ -206,7 +206,7 @@ void GeoHashCmd::Do(std::shared_ptr<Slot> slot) {
206206 const char * geoalphabet = " 0123456789bcdefghjkmnpqrstuvwxyz" ;
207207 res_.AppendArrayLenUint64 (members_.size ());
208208 for (const auto & member : members_) {
209- double score;
209+ double score = 0.0 ;
210210 rocksdb::Status s = slot->db ()->ZScore (key_, member, &score);
211211 if (s.ok ()) {
212212 double xy[2 ];
@@ -307,7 +307,7 @@ static void GetAllNeighbors(const std::shared_ptr<Slot>& slot, std::string& key,
307307 // Insert into result only if the point is within the search area.
308308 for (auto & score_member : score_members) {
309309 double xy[2 ];
310- double real_distance;
310+ double real_distance = 0.0 ;
311311 GeoHashBits hash = {.bits = static_cast <uint64_t >(score_member.score ), .step = GEO_STEP_MAX};
312312 geohashDecodeToLongLatWGS84 (hash, xy);
313313 if (geohashGetDistanceIfInRadiusWGS84 (longitude, latitude, xy[0 ], xy[1 ], distance, &real_distance) != 0 ) {
@@ -542,7 +542,7 @@ void GeoRadiusByMemberCmd::DoInitial() {
542542}
543543
544544void GeoRadiusByMemberCmd::Do (std::shared_ptr<Slot> slot) {
545- double score;
545+ double score = 0.0 ;
546546 rocksdb::Status s = slot->db ()->ZScore (key_, range_.member , &score);
547547 if (s.ok ()) {
548548 double xy[2 ];
0 commit comments