diff options
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java index 9e05a39731..f3726868cb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java @@ -474,11 +474,9 @@ public abstract class RefDatabase { */ @NonNull public List<Ref> getRefsByPrefix(String... prefixes) throws IOException { - List<Ref> result = new ArrayList<>(); - for (String prefix : prefixes) { - result.addAll(getRefsByPrefix(prefix)); - } - return Collections.unmodifiableList(result); + return getRefsByPrefix(ALL).parallelStream().filter( + ref -> Stream.of(prefixes).anyMatch(ref.getName()::startsWith)) + .collect(Collectors.toUnmodifiableList()); } |