From 2f280a7baf652bfe6dfbf5c6bbd69f5852c75080 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 6 Jun 2026 13:23:44 -0700 Subject: [PATCH] =?UTF-8?q?sls=5Fseq=5Fplugin:=20fix=20`break`=20=E2=86=92?= =?UTF-8?q?=20`continue`=20in=20`add=5Fsubstr=5Fedit=5Fupdates`=20(#9735)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `add_substr_edit_updates` uses a `HashSet` to deduplicate substrings of `val_other`, but on a duplicate hit it `break`s the inner loop instead of skipping just that entry. This causes all longer substrings from the same starting position to be silently dropped as repair candidates. ## Change - **`src/ast/sls/sls_seq_plugin.cpp`** — replace `break` with `continue` in the inner substring-enumeration loop. ```cpp // Before — exits the inner loop on first duplicate, missing e.g. "ab" in "aab" if (set.contains(sub)) break; // After — skips only the duplicate, continues with longer substrings at same offset if (set.contains(sub)) continue; ``` For `val_other = "aab"`, the old code never proposed `"ab"` (i=1, j=2) as a repair candidate because the duplicate `"a"` (i=1, j=1) terminated the inner loop prematurely. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/ast/sls/sls_seq_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ast/sls/sls_seq_plugin.cpp b/src/ast/sls/sls_seq_plugin.cpp index 0221e9f1d..5563ade51 100644 --- a/src/ast/sls/sls_seq_plugin.cpp +++ b/src/ast/sls/sls_seq_plugin.cpp @@ -753,7 +753,7 @@ namespace sls { for (unsigned j = 1; j <= val_other.length() - i; ++j) { zstring sub = val_other.extract(i, j); if (set.contains(sub)) - break; + continue; set.insert(sub); } }