[ 
https://issues.apache.org/jira/browse/GEODE-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282077#comment-16282077
 ] 

ASF GitHub Bot commented on GEODE-3288:
---------------------------------------

dgkimura commented on a change in pull request #165: GEODE-3288: Converts 
CacheableString to std::string.
URL: https://github.com/apache/geode-native/pull/165#discussion_r155358380
 
 

 ##########
 File path: cppcache/src/PdxInstanceImpl.cpp
 ##########
 @@ -229,22 +225,13 @@ void 
PdxInstanceImpl::writeField(std::shared_ptr<PdxWriter> writer,
           dynamic_cast<CacheableStringArray*>(value.get());
       if (val != nullptr) {
         int size = val->length();
-        if (val->operator[](0)->isCString()) {
-          char** strings = new char*[size];
-          for (int item = 0; item < size; item++) {
-            strings[item] = const_cast<char*>(val->operator[](item)->asChar());
-          }
-          writer->writeStringArray(fieldName, strings, size);
-          delete[] strings;
-        } else if (val->operator[](0)->isWideString()) {
-          wchar_t** strings = new wchar_t*[size];
-          for (int item = 0; item < size; item++) {
-            strings[item] =
-                const_cast<wchar_t*>(val->operator[](item)->asWChar());
-          }
-          writer->writeWideStringArray(fieldName, strings, size);
-          delete[] strings;
+        char** strings = new char*[size];
 
 Review comment:
   Does this need to be allocated on the heap?  Any reason it can't be vector 
on the stack of string?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Replace char* with std::string
> ------------------------------
>
>                 Key: GEODE-3288
>                 URL: https://issues.apache.org/jira/browse/GEODE-3288
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Ernest Burghardt
>
> In all public API headers



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to