Skip to content

Commit e393dec

Browse files
committed
Use Set instead of HashSet in diagnostic match helpers
1 parent 8b24f5a commit e393dec

File tree

1 file changed

+4
-4
lines changed
  • server/src/main/kotlin/org/javacs/kt/codeaction/quickfix

1 file changed

+4
-4
lines changed

server/src/main/kotlin/org/javacs/kt/codeaction/quickfix/QuickFix.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ interface QuickFix {
1414
fun compute(file: CompiledFile, range: Range, diagnostics: List<Diagnostic>): Either<Command, CodeAction>?
1515
}
1616

17-
fun diagnosticMatch(diagnostic: Diagnostic, range: Range, diagnosticTypes: HashSet<String>): Boolean =
17+
fun diagnosticMatch(diagnostic: Diagnostic, range: Range, diagnosticTypes: Set<String>): Boolean =
1818
diagnostic.range.equals(range) && diagnosticTypes.contains(diagnostic.code.left)
1919

20-
fun diagnosticMatch(diagnostic: KotlinDiagnostic, startCursor: Int, endCursor: Int, diagnosticTypes: HashSet<String>): Boolean =
20+
fun diagnosticMatch(diagnostic: KotlinDiagnostic, startCursor: Int, endCursor: Int, diagnosticTypes: Set<String>): Boolean =
2121
diagnostic.textRanges.any { it.startOffset == startCursor && it.endOffset == endCursor } && diagnosticTypes.contains(diagnostic.factory.name)
2222

23-
fun findDiagnosticMatch(diagnostics: List<Diagnostic>, range: Range, diagnosticTypes: HashSet<String>) =
23+
fun findDiagnosticMatch(diagnostics: List<Diagnostic>, range: Range, diagnosticTypes: Set<String>) =
2424
diagnostics.find { diagnosticMatch(it, range, diagnosticTypes) }
2525

26-
fun anyDiagnosticMatch(diagnostics: Diagnostics, startCursor: Int, endCursor: Int, diagnosticTypes: HashSet<String>) =
26+
fun anyDiagnosticMatch(diagnostics: Diagnostics, startCursor: Int, endCursor: Int, diagnosticTypes: Set<String>) =
2727
diagnostics.any { diagnosticMatch(it, startCursor, endCursor, diagnosticTypes) }

0 commit comments

Comments
 (0)