MCPcopy Create free account
hub / github.com/antlr/codebuff / findFirst

Method findFirst

src/org/antlr/codebuff/misc/BuffUtils.java:25–32  ·  view source on GitHub ↗
(List<T> data, Predicate<T> pred)

Source from the content-addressed store, hash-verified

23
24 // Generic filtering, mapping, joining that should be in the standard library but aren't
25 public static <T> T findFirst(List<T> data, Predicate<T> pred) {
26 if ( data!=null ) for (T x : data) {
27 if ( pred.test(x) ) {
28 return x;
29 }
30 }
31 return null;
32 }
33
34 public static <T> List<T> filter(List<T> data, Predicate<T> pred) {
35 List<T> output = new ArrayList<>();

Callers

nothing calls this directly

Calls 1

testMethod · 0.45

Tested by

no test coverage detected