Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Remove unnecessary synchronising
Dieser Commit ist enthalten in:
Ursprung
21eb824395
Commit
ce286cf322
@ -37,8 +37,7 @@ public class BukkitViaInjector implements ViaInjector {
|
|||||||
// Inject the list
|
// Inject the list
|
||||||
List wrapper = new ListWrapper((List) value) {
|
List wrapper = new ListWrapper((List) value) {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void handleAdd(Object o) {
|
public void handleAdd(Object o) {
|
||||||
synchronized (this) {
|
|
||||||
if (o instanceof ChannelFuture) {
|
if (o instanceof ChannelFuture) {
|
||||||
try {
|
try {
|
||||||
injectChannelFuture((ChannelFuture) o);
|
injectChannelFuture((ChannelFuture) o);
|
||||||
@ -47,7 +46,6 @@ public class BukkitViaInjector implements ViaInjector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
injectedLists.add(new Pair<>(field, connection));
|
injectedLists.add(new Pair<>(field, connection));
|
||||||
field.set(connection, wrapper);
|
field.set(connection, wrapper);
|
||||||
|
@ -36,8 +36,7 @@ public class SpongeViaInjector implements ViaInjector {
|
|||||||
// Inject the list
|
// Inject the list
|
||||||
List wrapper = new ListWrapper((List) value) {
|
List wrapper = new ListWrapper((List) value) {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void handleAdd(Object o) {
|
public void handleAdd(Object o) {
|
||||||
synchronized (this) {
|
|
||||||
if (o instanceof ChannelFuture) {
|
if (o instanceof ChannelFuture) {
|
||||||
try {
|
try {
|
||||||
injectChannelFuture((ChannelFuture) o);
|
injectChannelFuture((ChannelFuture) o);
|
||||||
@ -46,7 +45,6 @@ public class SpongeViaInjector implements ViaInjector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
injectedLists.add(new Pair<>(field, connection));
|
injectedLists.add(new Pair<>(field, connection));
|
||||||
field.set(connection, wrapper);
|
field.set(connection, wrapper);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren