mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Switch zip to zip_equal where possible (#6389)
There are two uses I'm not converting here, that seem to want the "shortest" behavior. For everything else, I'm going to `zip_equal` since it's more restrictive. I wish `zip` were named `zip_shortest`.
This commit is contained in:
@@ -82,7 +82,8 @@ static auto DiagnoseDuplicateNames(
|
||||
llvm::ArrayRef<SemIR::StructTypeField> fields, bool is_struct_type_literal)
|
||||
-> bool {
|
||||
Map<SemIR::NameId, Parse::NodeId> names;
|
||||
for (auto [field_name_node, field] : llvm::zip(field_name_nodes, fields)) {
|
||||
for (auto [field_name_node, field] :
|
||||
llvm::zip_equal(field_name_nodes, fields)) {
|
||||
auto result = names.Insert(field.name_id, field_name_node);
|
||||
if (!result.is_inserted()) {
|
||||
CARBON_DIAGNOSTIC(StructNameDuplicate, Error,
|
||||
|
||||
Reference in New Issue
Block a user