Explorar o código

Inline rescore function

Kirk Trombley %!s(int64=3) %!d(string=hai) anos
pai
achega
184208f75b
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  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