refactor: make getGoodsLimit one liner

This commit is contained in:
Breno A. 2024-06-09 08:50:40 -03:00
parent 6bb349d92b
commit da61d30f44

View File

@ -896,10 +896,8 @@ public class Player implements PlayerHook, FieldFetch {
}
public ShopLimit getGoodsLimit(int goodsId) {
Optional<ShopLimit> shopLimit = this.shopLimit.stream().filter(x -> x.getShopGoodId() == goodsId).findFirst();
if (shopLimit.isEmpty())
return null;
return shopLimit.get();
Optional<ShopLimit> limitOptional = this.shopLimit.stream().filter(x -> x.getShopGoodId() == goodsId).findFirst();
return limitOptional.orElse(null);
}
public void addShopLimit(int goodsId, int boughtCount, int nextRefreshTime) {