You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: common/src/main/kotlin/com/lambda/util/world/EntityUtils.kt
+11-13Lines changed: 11 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,8 @@ object EntityUtils {
23
23
noinline predicate: (T) ->Boolean = { true },
24
24
): T? {
25
25
// Speculative execution trolling
26
-
val entities =
27
-
if (range >64) getEntities(predicate)
26
+
val entities =ArrayList<T>()
27
+
if (range >64) getEntities(entities, predicate)
28
28
// I have an idea for optimization.
29
29
//
30
30
// Since the search operates linearly, eventually it will reach the midpoint.
@@ -33,7 +33,7 @@ object EntityUtils {
33
33
// Theoretically, the closest entity should be within a cubic space of delta^3 blocks.
34
34
// If there are no entities within this delta box, examine the outer box. (Although this is unlikely given the fact that the closest entity is within the delta box.)
35
35
// The performance improvement is relative to the initial state.
0 commit comments