From 2d97d8b78809fcc71d023eaa7cce0ce786e3fe98 Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Fri, 21 Jul 2023 20:27:57 -0500 Subject: [PATCH] Remove some streams from hot code --- src/main/java/io/papermc/codebook/pages/FixJarPage.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/papermc/codebook/pages/FixJarPage.java b/src/main/java/io/papermc/codebook/pages/FixJarPage.java index a185578..746c8f5 100644 --- a/src/main/java/io/papermc/codebook/pages/FixJarPage.java +++ b/src/main/java/io/papermc/codebook/pages/FixJarPage.java @@ -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; @@ -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)); } @@ -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)); } }