Skip to content

Commit

Permalink
Extract test occurrences faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
toinehartman committed Jul 2, 2024
1 parent edec500 commit c51164d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rascal-lsp/src/main/rascal/lang/rascal/tests/Rename.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,8 @@ set[int] extractRenameOccurrences(loc moduleFileName, list[DocumentEdit] edits,
}

if ([changed(_, replaces)] := edits) {
idx = {};
for (replace(l, _) <- replaces, i := indexOf(oldNameOccurrences, l)) {
if (i == -1) throw "Cannot find <l> in <oldNameOccurrences>";
idx += i;
}

return idx;
repls = {l | replace(l, _) <- replaces};
return {i | i <- [0..size(oldNameOccurrences)], oldNameOccurrences[i] in repls};;
} else {
throw "Unexpected changes: <edits>";
}
Expand Down

0 comments on commit c51164d

Please sign in to comment.