From 57398a4ea4a112cc2c152c3224d0c2bc39102ed4 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Thu, 24 Aug 2023 06:33:56 -0700 Subject: [PATCH] Optimize game.countGroup. (cherry picked from commit 0eac481969bcd104bf818e35889ed4fc1a0742f3) --- game/game.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/game/game.js b/game/game.js index 4e0db2c5a..dcb7e96c9 100644 --- a/game/game.js +++ b/game/game.js @@ -38815,13 +38815,12 @@ } return cards; }, - countGroup:function(){ - var list=lib.group.slice(0); - return game.countPlayer(function(current){ - if(list.contains(current.group)){ - list.remove(current.group); - return true; - } + countGroup:()=>{ + const list=lib.group.slice(0); + return game.countPlayer(current=>{ + if(!list.includes(current.group)) return false; + list.remove(current.group); + return true; }); }, players:[],