From 239a95961e1de882b0b4861b5d5b74477449f878 Mon Sep 17 00:00:00 2001 From: Brady Date: Mon, 24 Sep 2018 17:56:13 -0500 Subject: [PATCH] Replace for loop with forEach --- src/main/java/baritone/cache/CachedWorld.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/cache/CachedWorld.java b/src/main/java/baritone/cache/CachedWorld.java index 393c93fb..775d2849 100644 --- a/src/main/java/baritone/cache/CachedWorld.java +++ b/src/main/java/baritone/cache/CachedWorld.java @@ -116,9 +116,8 @@ public final class CachedWorld implements Helper { int regionZ = zoff + playerRegionZ; CachedRegion region = getOrCreateRegion(regionX, regionZ); if (region != null) { - for (BlockPos pos : region.getLocationsOf(block)) { - res.add(pos); - } + // TODO: 100% verify if this or addAll is faster. + region.getLocationsOf(block).forEach(res::add); } } }