mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Remove future allocation
This commit is contained in:
parent
6c242cbc7f
commit
d53d2ecea5
@ -11,7 +11,8 @@ public final class AsyncUtils {
|
|||||||
public static final CompletableFuture<Void> VOID_FUTURE = CompletableFuture.completedFuture(null);
|
public static final CompletableFuture<Void> VOID_FUTURE = CompletableFuture.completedFuture(null);
|
||||||
|
|
||||||
public static <T> CompletableFuture<T> empty() {
|
public static <T> CompletableFuture<T> empty() {
|
||||||
return CompletableFuture.completedFuture(null);
|
//noinspection unchecked
|
||||||
|
return (CompletableFuture<T>) VOID_FUTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static @NotNull CompletableFuture<Void> runAsync(@NotNull Runnable runnable) {
|
public static @NotNull CompletableFuture<Void> runAsync(@NotNull Runnable runnable) {
|
||||||
|
Loading…
Reference in New Issue
Block a user