This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new cc75993601 MINOR: [C++] Replace std::random_shuffle with std::shuffle 
(#13948)
cc75993601 is described below

commit cc7599360133e07458aa7e07562ade5b8c419d8c
Author: Bryce Mecum <[email protected]>
AuthorDate: Tue Aug 23 05:19:41 2022 -0800

    MINOR: [C++] Replace std::random_shuffle with std::shuffle (#13948)
    
    `std::random_shuffle` was deprecated in C++14 and removed altogether in 
C++17 in favor of `std::shuffle`. The codebase only uses these shuffling 
functions in tests and benchmarks and `std::shuffle` is used in all instances 
except this one.
    
    Authored-by: Bryce Mecum <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 cpp/src/arrow/adapters/orc/adapter_test.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/arrow/adapters/orc/adapter_test.cc 
b/cpp/src/arrow/adapters/orc/adapter_test.cc
index 6914d6b9c1..1efc02bc40 100644
--- a/cpp/src/arrow/adapters/orc/adapter_test.cc
+++ b/cpp/src/arrow/adapters/orc/adapter_test.cc
@@ -173,7 +173,7 @@ void RandWeakComposition(int64_t n, T sum, std::vector<U>* 
out) {
     return static_cast<U>(res);
   });
   (*out)[n - 1] += remaining_sum;
-  std::random_shuffle(out->begin(), out->end());
+  std::shuffle(out->begin(), out->end(), gen);
 }
 
 std::shared_ptr<ChunkedArray> GenerateRandomChunkedArray(

Reply via email to