diff --git a/src/DataTypes/Serializations/SerializationDecimalBase.cpp b/src/DataTypes/Serializations/SerializationDecimalBase.cpp index 37edfffc0d4..b7f91e6833e 100644 --- a/src/DataTypes/Serializations/SerializationDecimalBase.cpp +++ b/src/DataTypes/Serializations/SerializationDecimalBase.cpp @@ -34,10 +34,8 @@ void SerializationDecimalBase::serializeBinaryBulk(const IColumn & column, Wr limit = size - offset; if constexpr (std::endian::native == std::endian::big) - { - std::ranges::for_each( - x | std::views::drop(offset) | std::views::take(limit), [&ostr](const auto & d) { writeBinaryLittleEndian(d, ostr); }); - } + for (size_t i = offset; i < offset + limit; ++i) + writeBinaryLittleEndian(x[i], ostr); else ostr.write(reinterpret_cast(&x[offset]), sizeof(FieldType) * limit); } @@ -68,8 +66,8 @@ void SerializationDecimalBase::deserializeBinaryBulk(IColumn & column, ReadBu x.resize(initial_size + size / sizeof(FieldType)); if constexpr (std::endian::native == std::endian::big) - std::ranges::for_each( - x | std::views::drop(initial_size), [](auto & d) { transformEndianness(d); }); + for (size_t i = initial_size; i < x.size(); ++i) + transformEndianness(x[i]); } template class SerializationDecimalBase; diff --git a/src/DataTypes/Serializations/SerializationNumber.cpp b/src/DataTypes/Serializations/SerializationNumber.cpp index fc3a5f0db24..94b44d5cc66 100644 --- a/src/DataTypes/Serializations/SerializationNumber.cpp +++ b/src/DataTypes/Serializations/SerializationNumber.cpp @@ -144,10 +144,8 @@ void SerializationNumber::serializeBinaryBulk(const IColumn & column, WriteBu return; if constexpr (std::endian::native == std::endian::big && sizeof(T) >= 2) - { - std::ranges::for_each( - x | std::views::drop(offset) | std::views::take(limit), [&ostr](const auto & i) { writeBinaryLittleEndian(i, ostr); }); - } + for (size_t i = offset; i < offset + limit; ++i) + writeBinaryLittleEndian(x[i], ostr); else ostr.write(reinterpret_cast(&x[offset]), sizeof(typename ColumnVector::ValueType) * limit); } @@ -162,7 +160,8 @@ void SerializationNumber::deserializeBinaryBulk(IColumn & column, ReadBuffer x.resize(initial_size + size / sizeof(typename ColumnVector::ValueType)); if constexpr (std::endian::native == std::endian::big && sizeof(T) >= 2) - std::ranges::for_each(x | std::views::drop(initial_size), [](auto & i) { transformEndianness(i); }); + for (size_t i = initial_size; i < x.size(); ++i) + transformEndianness(x[i]); } template class SerializationNumber; diff --git a/src/DataTypes/Serializations/SerializationUUID.cpp b/src/DataTypes/Serializations/SerializationUUID.cpp index 13ae8fa9a78..613a16541f5 100644 --- a/src/DataTypes/Serializations/SerializationUUID.cpp +++ b/src/DataTypes/Serializations/SerializationUUID.cpp @@ -147,8 +147,8 @@ void SerializationUUID::serializeBinaryBulk(const IColumn & column, WriteBuffer { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunreachable-code" - std::ranges::for_each( - x | std::views::drop(offset) | std::views::take(limit), [&ostr](const auto & uuid) { writeBinaryLittleEndian(uuid, ostr); }); + for (size_t i = offset; i < offset + limit; ++i) + writeBinaryLittleEndian(x[i], ostr); #pragma clang diagnostic pop } else @@ -166,8 +166,8 @@ void SerializationUUID::deserializeBinaryBulk(IColumn & column, ReadBuffer & ist #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunreachable-code" if constexpr (std::endian::native == std::endian::big) - std::ranges::for_each( - x | std::views::drop(initial_size), [](auto & uuid) { transformEndianness(uuid); }); + for (size_t i = initial_size; i < x.size(); ++i) + transformEndianness(x[i]); #pragma clang diagnostic pop } }