Skip to content

Commit c201bb7

Browse files
committed
Simplify a few operations on streams
1 parent 94575e8 commit c201bb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/engineering/swat/watch/TestHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ private Events(Stream<WatchEvent> stream) {
102102
}
103103

104104
public boolean any() {
105-
return stream.anyMatch(e -> true);
105+
return stream.findAny().isPresent();
106106
}
107107

108108
public boolean any(WatchEvent event) {
109109
return stream.anyMatch(e -> WatchEvent.areEquivalent(e, event));
110110
}
111111

112112
public boolean none() {
113-
return stream.noneMatch(e -> true);
113+
return !any();
114114
}
115115

116116
public boolean none(WatchEvent event) {
117-
return stream.noneMatch(e -> WatchEvent.areEquivalent(e, event));
117+
return !any(event);
118118
}
119119

120120
public Events kind(WatchEvent.Kind... kinds) {

0 commit comments

Comments
 (0)