Skip to content

Commit 3c41cc8

Browse files
authored
Attempt to fix MSVC failure (#66)
1 parent 488c4bb commit 3c41cc8

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/flatbuffer_utils.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <numeric>
12
#include <string>
23

34
#include "compression_impl.hpp"
@@ -523,7 +524,7 @@ namespace sparrow_ipc
523524
create_fieldnodes(const sparrow::record_batch& record_batch)
524525
{
525526
std::vector<org::apache::arrow::flatbuf::FieldNode> nodes;
526-
nodes.reserve(record_batch.columns().size());
527+
nodes.reserve(record_batch.nb_columns());
527528
for (const auto& column : record_batch.columns())
528529
{
529530
fill_fieldnodes(sparrow::detail::array_access::get_arrow_proxy(column), nodes);
@@ -608,9 +609,10 @@ namespace sparrow_ipc
608609
std::optional<CompressionType> compression,
609610
std::optional<std::reference_wrapper<CompressionCache>> cache)
610611
{
612+
auto cols = record_batch.columns();
611613
return std::accumulate(
612-
record_batch.columns().begin(),
613-
record_batch.columns().end(),
614+
cols.begin(),
615+
cols.end(),
614616
int64_t{0},
615617
[&](int64_t acc, const sparrow::array& arr)
616618
{

src/metadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ namespace sparrow_ipc
2020
);
2121
return sparrow_metadata;
2222
}
23-
}
23+
}

src/serialize_utils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <algorithm>
12
#include <stdexcept>
23

34
#include "sparrow_ipc/flatbuffer_utils.hpp"
@@ -38,7 +39,7 @@ namespace sparrow_ipc
3839
std::optional<CompressionType> compression,
3940
std::optional<std::reference_wrapper<CompressionCache>> cache)
4041
{
41-
std::for_each(record_batch.columns().begin(), record_batch.columns().end(), [&](const auto& column) {
42+
std::ranges::for_each(record_batch.columns(), [&](const auto& column) {
4243
const auto& arrow_proxy = sparrow::detail::array_access::get_arrow_proxy(column);
4344
fill_body(arrow_proxy, stream, compression, cache);
4445
});

src/serializer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ namespace sparrow_ipc
3939
m_stream.write(end_of_stream);
4040
m_ended = true;
4141
}
42-
}
42+
}

0 commit comments

Comments
 (0)