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:
Jon Ross-Perkins
2025-11-18 00:28:06 +00:00
committed by GitHub
parent 205aea9a3e
commit fbc7690157
13 changed files with 34 additions and 31 deletions
+1 -1
View File
@@ -527,7 +527,7 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
auto add_all_subscrutinees =
[&](llvm::ArrayRef<SemIR::InstId> subscrutinee_ids) {
for (auto [subpattern_id, subscrutinee_id] :
llvm::reverse(llvm::zip(subpattern_ids, subscrutinee_ids))) {
llvm::reverse(llvm::zip_equal(subpattern_ids, subscrutinee_ids))) {
AddWork(
{.pattern_id = subpattern_id, .scrutinee_id = subscrutinee_id});
}