Skip to content

Commit

Permalink
Simplified siblings() a little
Browse files Browse the repository at this point in the history
  • Loading branch information
jhy committed Dec 16, 2024
1 parent 0a2a2c4 commit 515423d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/jsoup/select/Elements.java
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,7 @@ private Elements siblings(@Nullable String query, boolean next, boolean all) {
do {
Element sib = next ? e.nextElementSibling() : e.previousElementSibling();
if (sib == null) break;
if (eval == null)
els.add(sib);
else if (sib.is(eval))
els.add(sib);
if (eval == null || sib.is(eval)) els.add(sib);
e = sib;
} while (all);
}
Expand Down

0 comments on commit 515423d

Please # to comment.