Skip to content

Commit

Permalink
Remove some streams from hot code
Browse files Browse the repository at this point in the history
  • Loading branch information
DenWav committed Jul 22, 2023
1 parent 159f758 commit 2d97d8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/papermc/codebook/pages/FixJarPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import static java.util.Objects.requireNonNullElse;

import com.google.common.collect.Iterables;
import dev.denwav.hypo.asm.AsmClassData;
import dev.denwav.hypo.asm.AsmClassDataProvider;
import dev.denwav.hypo.asm.AsmConstructorData;
Expand Down Expand Up @@ -134,7 +135,7 @@ private static void addAnnotations(final AsmClassData classData) {
final MethodNode node = ((AsmMethodData) method).getNode();
final var annoClass = "Ljava/lang/Override;";
if (node.invisibleAnnotations == null
|| node.invisibleAnnotations.stream().noneMatch(a -> a.desc.equals(annoClass))) {
|| !Iterables.any(node.invisibleAnnotations, a -> a.desc.equals(annoClass))) {
node.invisibleAnnotations =
appendToList(node.invisibleAnnotations, new AnnotationNode(annoClass));
}
Expand Down Expand Up @@ -165,7 +166,7 @@ private static void addAnnotations(final AsmClassData classData) {
if ((node.access & Opcodes.ACC_DEPRECATED) != 0) {
final var annoClass = "Ljava/lang/Deprecated;";
if (node.visibleAnnotations == null
|| node.visibleAnnotations.stream().noneMatch(a -> a.desc.equals(annoClass))) {
|| !Iterables.any(node.visibleAnnotations, a -> a.desc.equals(annoClass))) {
node.visibleAnnotations = appendToList(node.visibleAnnotations, new AnnotationNode(annoClass));
}
}
Expand Down

0 comments on commit 2d97d8b

Please sign in to comment.