Skip to content

Commit 73703d4

Browse files
authored
refact: combine two filter conditions into one (#1241)
to reduce the overhead of filtering proposals.
1 parent bc2b823 commit 73703d4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/completion/LSContentAssistProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ private static List<ICompletionProposal> toProposals(IDocument document, int off
271271
.filter(proposal -> {
272272
// Stop the compute of ICompletionProposal if the completion has been cancelled
273273
cancelChecker.checkCanceled();
274-
return true;
275-
}).filter(proposal -> proposal.validate(document, offset, null)) //
276-
.map(ICompletionProposal.class::cast)
274+
return proposal.validate(document, offset, null);
275+
}).map(ICompletionProposal.class::cast)
277276
.toList();
278277
}
279278

0 commit comments

Comments
 (0)