You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/12 04:31:54 UTC

[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #8958: [refactor] Unify all unit tests into one binary file

yiguolei commented on code in PR #8958:
URL: https://github.com/apache/incubator-doris/pull/8958#discussion_r847956940


##########
be/src/geo/geo_functions.cpp:
##########
@@ -267,22 +268,21 @@ doris_udf::BooleanVal GeoFunctions::st_contains(doris_udf::FunctionContext* ctx,
     if (state != nullptr && state->is_null) {
         return BooleanVal::null();
     }
-    GeoShape* shapes[2] = {nullptr, nullptr};
+    std::vector<std::shared_ptr<GeoShape>> shapes = {nullptr, nullptr};
     const StringVal* strs[2] = {&lhs, &rhs};
-    // use this to delete new
-    StContainsState local_state;
     for (int i = 0; i < 2; ++i) {
         if (state != nullptr && state->shapes[i] != nullptr) {
             shapes[i] = state->shapes[i];
         } else {
-            shapes[i] = local_state.shapes[i] = GeoShape::from_encoded(strs[i]->ptr, strs[i]->len);
+            shapes[i] =
+                    std::shared_ptr<GeoShape>(GeoShape::from_encoded(strs[i]->ptr, strs[i]->len));
             if (shapes[i] == nullptr) {
                 return BooleanVal::null();
             }
         }
     }
 
-    return shapes[0]->contains(shapes[1]);
+    return shapes[0]->contains(shapes[1].get());

Review Comment:
   Has to add get() here?



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org