Skip to content

Commit

Permalink
Convert evaluator predicate to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Nov 18, 2023
1 parent 4ffc5be commit 369d01d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/main/java/org/jsoup/select/Evaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,7 @@ protected Evaluator() {
* @since 1.17.1
*/
public Predicate<Element> asPredicate(Element root) {
//noinspection ReturnOfInnerClass
return new MatchPredicate(root);
}

class MatchPredicate implements Predicate<Element> {
final Element root;

public MatchPredicate(Element root) {
this.root = root;
}

@Override public boolean test(Element element) {
return matches(root, element);
}
return element -> matches(root, element);
}

/**
Expand Down

0 comments on commit 369d01d

Please sign in to comment.