Replace for loop with forEach
This commit is contained in:
parent
3e189510d4
commit
239a95961e
@ -116,9 +116,8 @@ public final class CachedWorld implements Helper {
|
|||||||
int regionZ = zoff + playerRegionZ;
|
int regionZ = zoff + playerRegionZ;
|
||||||
CachedRegion region = getOrCreateRegion(regionX, regionZ);
|
CachedRegion region = getOrCreateRegion(regionX, regionZ);
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
for (BlockPos pos : region.getLocationsOf(block)) {
|
// TODO: 100% verify if this or addAll is faster.
|
||||||
res.add(pos);
|
region.getLocationsOf(block).forEach(res::add);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user