You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by GitBox <gi...@apache.org> on 2022/11/17 09:31:02 UTC

[GitHub] [orc] coderex2522 commented on a diff in pull request #1317: ORC-1314: [C++] Remove macros defined before C++11

coderex2522 commented on code in PR #1317:
URL: https://github.com/apache/orc/pull/1317#discussion_r1024948137


##########
c++/src/ColumnPrinter.cc:
##########
@@ -319,10 +319,8 @@ namespace orc {
     if (hasNulls && !notNull[rowId]) {
       writeString(buffer, "null");
     } else {
-      char numBuffer[64];
-      snprintf(numBuffer, sizeof(numBuffer), "%" INT64_FORMAT_STRING "d",
-               static_cast<int64_t>(data[rowId]));
-      writeString(buffer, numBuffer);
+      const auto numBuffer = std::to_string(static_cast<int64_t>(data[rowId]));
+      writeString(buffer, numBuffer.c_str());

Review Comment:
   +1 LGTM. And I suggest that writeString(std::string& file, const char* ptr) function can be optimized as writeString(std::string& file, const std::string& str).



-- 
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: issues-unsubscribe@orc.apache.org

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