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/05/23 03:20:32 UTC

[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9727: [opt] avoid memcpy when building page

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


##########
be/src/util/faststring.cc:
##########
@@ -37,18 +37,20 @@ void faststring::GrowToAtLeast(size_t newcapacity) {
 
 void faststring::GrowArray(size_t newcapacity) {
     DCHECK_GE(newcapacity, capacity_);
-    std::unique_ptr<uint8_t[]> newdata(new uint8_t[newcapacity]);
-    if (len_ > 0) {
-        memcpy(&newdata[0], &data_[0], len_);
-    }
-    capacity_ = newcapacity;
+    uint8_t* newdata = NULL;

Review Comment:
   Not use NULL, use nullptr please.



-- 
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