From b4ddc96d363885e2b010e2cdb9ac517ca307957a Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 4 Nov 2020 13:57:20 +0900 Subject: [PATCH] ARROW-10490: [C++][GLib] Fix range-loop-analysis warnings They are detected by Xcode 12. Closes #8587 from kou/xcode-12 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- c_glib/arrow-glib/reader.cpp | 4 ++-- cpp/src/plasma/protocol.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c_glib/arrow-glib/reader.cpp b/c_glib/arrow-glib/reader.cpp index f2202515965ea..c3082271ca562 100644 --- a/c_glib/arrow-glib/reader.cpp +++ b/c_glib/arrow-glib/reader.cpp @@ -1184,7 +1184,7 @@ garrow_csv_read_options_add_schema(GArrowCSVReadOptions *options, { auto priv = GARROW_CSV_READ_OPTIONS_GET_PRIVATE(options); auto arrow_schema = garrow_schema_get_raw(schema); - for (const auto field : arrow_schema->fields()) { + for (const auto &field : arrow_schema->fields()) { priv->convert_options.column_types[field->name()] = field->type(); } } @@ -1206,7 +1206,7 @@ garrow_csv_read_options_get_column_types(GArrowCSVReadOptions *options) g_str_equal, g_free, g_object_unref); - for (const auto iter : priv->convert_options.column_types) { + for (const auto &iter : priv->convert_options.column_types) { auto arrow_name = iter.first; auto arrow_data_type = iter.second; g_hash_table_insert(types, diff --git a/cpp/src/plasma/protocol.cc b/cpp/src/plasma/protocol.cc index 69d53e7432d7a..735636cda9fcd 100644 --- a/cpp/src/plasma/protocol.cc +++ b/cpp/src/plasma/protocol.cc @@ -581,7 +581,7 @@ Status ReadListReply(const uint8_t* data, size_t size, ObjectTable* objects) { DCHECK(data); auto message = flatbuffers::GetRoot(data); DCHECK(VerifyFlatbuffer(message, data, size)); - for (auto const& object : *message->objects()) { + for (auto const object : *message->objects()) { ObjectID object_id = ObjectID::from_binary(object->object_id()->str()); auto entry = std::unique_ptr(new ObjectTableEntry()); entry->data_size = object->data_size();