Skip to content

Commit e395631

Browse files
committed
Merge branch 'master' into mc-update
2 parents 33af759 + 3c64084 commit e395631

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/main/java/meteordevelopment/meteorclient/utils/misc/Pool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public final class Pool<T> {
1414
private final Queue<T> items = new ArrayDeque<>();
1515
private final Supplier<T> producer;
1616

17-
public Pool(Supplier<T> producer) {
18-
this.producer = producer;
17+
public Pool(Producer<T> producer) {
18+
this.producer = producer::create;
1919
}
2020

2121
public synchronized T get() {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3+
* Copyright (c) Meteor Development.
4+
*/
5+
6+
package meteordevelopment.meteorclient.utils.misc;
7+
8+
public interface Producer<T> {
9+
T create();
10+
}

0 commit comments

Comments
 (0)