mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
perf: do not double call Map get (microoptimization)
This commit is contained in:
@@ -301,11 +301,10 @@ public class CosmeticUser implements CosmeticHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateCosmetic(@NotNull CosmeticSlot slot) {
|
public void updateCosmetic(@NotNull CosmeticSlot slot) {
|
||||||
if (getCosmetic(slot) == null) {
|
Cosmetic cosmetic = playerCosmetics.get(slot);
|
||||||
return;
|
if (cosmetic != null) {
|
||||||
|
cosmetic.update(this);
|
||||||
}
|
}
|
||||||
getCosmetic(slot).update(this);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateCosmetic(Cosmetic cosmetic) {
|
public void updateCosmetic(Cosmetic cosmetic) {
|
||||||
|
|||||||
Reference in New Issue
Block a user