From 79207630019a46a53e3d43042acd02616ee4ead5 Mon Sep 17 00:00:00 2001 From: Rintim Date: Fri, 13 Oct 2023 01:25:54 +0800 Subject: [PATCH] perf: use lambda refactor. --- game/game.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/game/game.js b/game/game.js index 5c73e0651..4afabfbe6 100644 --- a/game/game.js +++ b/game/game.js @@ -58878,15 +58878,9 @@ population:identity=>identity==undefined? game.players.length+game.dead.length: game.players.filter(current=>current.identity==identity).length, - totalPopulation:identity=>{ - if(identity==undefined) return game.players.length+game.dead.length; - var i,players=game.players.concat(game.dead); - var num=0; - for(i=0;iidentity==undefined? + game.players.length+game.dead.length: + game.players.concat(game.dead).filter(current=>current.identity==identity).length, cardtag:(item,tag)=>{ if(item.cardid&&(get.itemtype(item)=='card'||!item.cards||!item.cards.length||item.name==item.cards[0].name)&&_status.cardtag&&_status.cardtag[tag]&&_status.cardtag[tag].contains(item.cardid)){ return true;