From 7114ef2a204573496daf9dcef2a7eb07b784e73d Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Wed, 25 Sep 2024 13:41:18 -0400 Subject: [PATCH] Reduced copying --- src/pantab/writer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pantab/writer.cpp b/src/pantab/writer.cpp index 3c1004b3..bc384183 100644 --- a/src/pantab/writer.cpp +++ b/src/pantab/writer.cpp @@ -191,11 +191,11 @@ template 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(buffer_view.size_bytes)}; + const std::string result{buffer_view.data.as_char, + static_cast(buffer_view.size_bytes)}; #else - const auto result = std::string_view{ - buffer_view.data.as_char, static_cast(buffer_view.size_bytes)}; + const std::string_view result{buffer_view.data.as_char, + static_cast(buffer_view.size_bytes)}; #endif hyperapi::internal::ValueInserter{inserter_}.addValue(result); } @@ -638,7 +638,7 @@ void write_to_hyper( // subtley different from hyper_columns with geo std::vector 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;