Skip to content

Commit

Permalink
Reduced copying (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored Sep 26, 2024
1 parent e58419d commit 8754dcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pantab/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ template <typename OffsetT> class Utf8InsertHelper : public InsertHelper {
const struct ArrowBufferView buffer_view =
ArrowArrayViewGetBytesUnsafe(array_view_.get(), idx);
#if defined(_WIN32) && defined(_MSC_VER)
const auto result = std::string{
buffer_view.data.as_char, static_cast<size_t>(buffer_view.size_bytes)};
const std::string result{buffer_view.data.as_char,
static_cast<size_t>(buffer_view.size_bytes)};
#else
const auto result = std::string_view{
buffer_view.data.as_char, static_cast<size_t>(buffer_view.size_bytes)};
const std::string_view result{buffer_view.data.as_char,
static_cast<size_t>(buffer_view.size_bytes)};
#endif
hyperapi::internal::ValueInserter{inserter_}.addValue(result);
}
Expand Down Expand Up @@ -650,7 +650,7 @@ void write_to_hyper(
// subtley different from hyper_columns with geo
std::vector<hyperapi::TableDefinition::Column> inserter_defs;
for (int64_t i = 0; i < schema->n_children; i++) {
const auto col_name = std::string{schema->children[i]->name};
const std::string col_name{schema->children[i]->name};
const auto nullability = not_null_set.find(col_name) != not_null_set.end()
? hyperapi::Nullability::NotNullable
: hyperapi::Nullability::Nullable;
Expand Down

0 comments on commit 8754dcf

Please sign in to comment.