From 3e57b007a88105f5570d1989bf2b43a4b53eb924 Mon Sep 17 00:00:00 2001 From: kothiga Date: Fri, 22 Sep 2023 12:25:17 -0700 Subject: [PATCH] Use LE version of unalignedStore. --- src/Processors/Formats/Impl/BSONEachRowRowInputFormat.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Processors/Formats/Impl/BSONEachRowRowInputFormat.cpp b/src/Processors/Formats/Impl/BSONEachRowRowInputFormat.cpp index ea8ed960595c..b38aaa426fd9 100644 --- a/src/Processors/Formats/Impl/BSONEachRowRowInputFormat.cpp +++ b/src/Processors/Formats/Impl/BSONEachRowRowInputFormat.cpp @@ -1045,13 +1045,7 @@ fileSegmentationEngineBSONEachRow(ReadBuffer & in, DB::Memory<> & memory, size_t size_t old_size = memory.size(); memory.resize(old_size + document_size); - - // Ensure the document size we write to the memory is byte arranged for LE. - BSONSizeT size_out = document_size; - if constexpr(std::endian::native == std::endian::big) - size_out = std::byteswap(size_out); - unalignedStore(memory.data() + old_size, size_out); - + unalignedStoreLittleEndian(memory.data() + old_size, document_size); in.readStrict(memory.data() + old_size + sizeof(document_size), document_size - sizeof(document_size)); ++number_of_rows; }