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

ASF GitHub Bot commented on PARQUET-1267:
-----------------------------------------

xhochy closed pull request #451: PARQUET-1267: [C++] replace "unsafe" 
std::equal by std::memcmp
URL: https://github.com/apache/parquet-cpp/pull/451
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/parquet/types.h b/src/parquet/types.h
index 2179d508..04cfc4b5 100644
--- a/src/parquet/types.h
+++ b/src/parquet/types.h
@@ -155,7 +155,7 @@ struct ByteArray {
 };
 
 inline bool operator==(const ByteArray& left, const ByteArray& right) {
-  return left.len == right.len && std::equal(left.ptr, left.ptr + left.len, 
right.ptr);
+  return left.len == right.len && 0 == std::memcmp(left.ptr, right.ptr, 
left.len);
 }
 
 inline bool operator!=(const ByteArray& left, const ByteArray& right) {


 

----------------------------------------------------------------
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 "unsafe" std::equal by std::memcmp
> ------------------------------------------
>
>                 Key: PARQUET-1267
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1267
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-cpp
>            Reporter: rip.nsk
>            Priority: Trivial
>             Fix For: cpp-1.5.0
>
>
> std::equal(first1, last1, first2, size) is considered unsafe by msvc, replace 
> it by std::memcmp



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to