diff --git a/src/flatbuffer_utils.cpp b/src/flatbuffer_utils.cpp index 4c4e79a7..e8c39bdd 100644 --- a/src/flatbuffer_utils.cpp +++ b/src/flatbuffer_utils.cpp @@ -1,3 +1,4 @@ +#include #include #include "compression_impl.hpp" @@ -523,7 +524,7 @@ namespace sparrow_ipc create_fieldnodes(const sparrow::record_batch& record_batch) { std::vector nodes; - nodes.reserve(record_batch.columns().size()); + nodes.reserve(record_batch.nb_columns()); for (const auto& column : record_batch.columns()) { fill_fieldnodes(sparrow::detail::array_access::get_arrow_proxy(column), nodes); @@ -608,9 +609,10 @@ namespace sparrow_ipc std::optional compression, std::optional> cache) { + auto cols = record_batch.columns(); return std::accumulate( - record_batch.columns().begin(), - record_batch.columns().end(), + cols.begin(), + cols.end(), int64_t{0}, [&](int64_t acc, const sparrow::array& arr) { diff --git a/src/metadata.cpp b/src/metadata.cpp index 3638f766..699229b0 100644 --- a/src/metadata.cpp +++ b/src/metadata.cpp @@ -20,4 +20,4 @@ namespace sparrow_ipc ); return sparrow_metadata; } -} \ No newline at end of file +} diff --git a/src/serialize_utils.cpp b/src/serialize_utils.cpp index 45ab9708..528ff6f4 100644 --- a/src/serialize_utils.cpp +++ b/src/serialize_utils.cpp @@ -1,3 +1,4 @@ +#include #include #include "sparrow_ipc/flatbuffer_utils.hpp" @@ -38,7 +39,7 @@ namespace sparrow_ipc std::optional compression, std::optional> cache) { - std::for_each(record_batch.columns().begin(), record_batch.columns().end(), [&](const auto& column) { + std::ranges::for_each(record_batch.columns(), [&](const auto& column) { const auto& arrow_proxy = sparrow::detail::array_access::get_arrow_proxy(column); fill_body(arrow_proxy, stream, compression, cache); }); diff --git a/src/serializer.cpp b/src/serializer.cpp index b12459c3..f0e99dbc 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -39,4 +39,4 @@ namespace sparrow_ipc m_stream.write(end_of_stream); m_ended = true; } -} \ No newline at end of file +}