Skip to content

Commit

Permalink
Reflecting review feedback - adjusting javadoc and name.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Sep 6, 2024
1 parent acab89a commit 7849725
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,8 @@ private List<ClassSymbol> baseClasses(TypeSymbol root) {
* of patterns is replaced with a new set of patterns of the form:
* $record($prefix$, $resultOfReduction, $suffix$)
*
* useHashes: when true, patterns will be a subject to exact equivalence;
* when false, two bindings patterns will be considered equivalent
* useHashes: when true, patterns will be subject to exact equivalence;
* when false, two binding patterns will be considered equivalent
* if one of them is more generic than the other one;
* when false, the processing will be significantly slower,
* as pattern hashes cannot be used to speed up the matching process
Expand Down Expand Up @@ -1059,13 +1059,13 @@ private Set<PatternDescription> reduceNestedPatterns(Set<PatternDescription> pat
mismatchingCandidate < nestedPatternsCount;
mismatchingCandidate++) {
int mismatchingCandidateFin = mismatchingCandidate;
var groupByHashes =
var groupEquivalenceCandidates =
current
.stream()
//error recovery, ignore patterns with incorrect number of nested patterns:
.filter(pd -> pd.nested.length == nestedPatternsCount)
.collect(groupingBy(pd -> useHashes ? pd.hashCode(mismatchingCandidateFin) : 0));
for (var candidates : groupByHashes.values()) {
for (var candidates : groupEquivalenceCandidates.values()) {
var candidatesArr = candidates.toArray(RecordPattern[]::new);

for (int firstCandidate = 0;
Expand Down

0 comments on commit 7849725

Please sign in to comment.