Browse Source

Inline rescore function

Kirk Trombley 3 năm trước cách đây
mục cha
commit
184208f75b
1 tập tin đã thay đổi với 2 bổ sung4 xóa
  1. 2 4
      web/score.js

+ 2 - 4
web/score.js

@@ -1,6 +1,6 @@
 const currentScores = {};
 
-const rescore = (target, { name, jab, rgb }) => {
+const rescoreAll = target => pokemonData.forEach(({ name, jab, rgb }) => {
   currentScores[name] = {
     jab: {
       total: applyMetrics(jab.total, target.jab),
@@ -11,9 +11,7 @@ const rescore = (target, { name, jab, rgb }) => {
       clusters: rgb.clusters.map(c => applyMetrics(c, target.rgb)),
     },
   };
-};
-
-const rescoreAll = target => pokemonData.forEach(pkmn => rescore(target, pkmn));
+});
 
 const getBestClusterIndex = (pkmn, space, { sortMetric, scaleOption, sortOrder }) => {
   // get the scales