From d0e1063a9b5e97522c42772ae2af1e69e8b0df44 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Thu, 24 Aug 2023 06:38:17 -0700 Subject: [PATCH] Optimize game.findPlayer. (cherry picked from commit 9819bceb12a930c4be2f4a189def95ba0f0568ce) --- game/game.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/game/game.js b/game/game.js index 8d416413b..cb3d03c1d 100644 --- a/game/game.js +++ b/game/game.js @@ -38784,15 +38784,7 @@ if(typeof func!='function') func=lib.filter.all; return list.addArray(game.players.concat(game.dead).filter(value=>(includeOut||!value.isOut())&&func(value))); }, - findPlayer:function(func,includeOut){ - for(var i=0;igame.players.find(value=>(includeOut||!value.isOut())&&func(value))||null, findPlayer2:(func,includeOut)=>game.players.concat(game.dead).find(value=>(includeOut||!value.isOut())&&func(value))||null, findCards:(func,all)=>Object.keys(lib.card).filter(value=>{ if(!lib.translate[`${value}_info`]) return false;