mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
Optimize for loop!
This commit is contained in:
@@ -59,8 +59,7 @@ public class GiftsDataMapper {
|
|||||||
if (jsonObject.get("data") instanceof JsonObject data && data.get("gifts") instanceof JsonArray giftArray) {
|
if (jsonObject.get("data") instanceof JsonObject data && data.get("gifts") instanceof JsonArray giftArray) {
|
||||||
var gifts = new ArrayList<Gift>();
|
var gifts = new ArrayList<Gift>();
|
||||||
|
|
||||||
for(int i = 0; i < giftArray.size(); i++) {
|
for (JsonElement element : giftArray) {
|
||||||
JsonElement element = giftArray.get(i);
|
|
||||||
Gift gift = mapSingleRoomGift(element);
|
Gift gift = mapSingleRoomGift(element);
|
||||||
gifts.add(gift);
|
gifts.add(gift);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user