Use string_view

This commit is contained in:
avogar 2022-09-28 13:14:54 +00:00
parent 1bd7e531db
commit 2583e6d3ce

View File

@ -134,7 +134,7 @@ NamesAndTypesList IRowSchemaReader::readSchema()
} }
else else
{ {
std::unordered_set<String> names_set; std::unordered_set<std::string_view> names_set;
for (const auto & name : column_names) for (const auto & name : column_names)
{ {
if (names_set.contains(name)) if (names_set.contains(name))
@ -253,7 +253,7 @@ NamesAndTypesList IRowWithNamesSchemaReader::readSchema()
/// We reached eof. /// We reached eof.
break; break;
std::unordered_set<String> names_set; /// We should check for duplicate column names in current row std::unordered_set<std::string_view> names_set; /// We should check for duplicate column names in current row
for (auto & [name, new_type] : new_names_and_types) for (auto & [name, new_type] : new_names_and_types)
{ {
if (names_set.contains(name)) if (names_set.contains(name))