浏览代码

Inline rescore function

Kirk Trombley 3 年之前
父节点
当前提交
184208f75b
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      web/score.js

+ 2 - 4
web/score.js

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