Skip to content

Commit

Permalink
Chore: rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Sep 22, 2024
1 parent aabc28f commit 871af2d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/state/optimizer/optimizerSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,22 +410,22 @@ export function createSettingsPerCalculation(

// affixesArray: valid affixes for each slot, taking forced slots into account
// e.g. [[Berserker, Assassin], [Assassin], [Berserker, Assassin]...]
let settings_affixesArray: OptimizerCoreSettings['affixesArray'] = new Array(
const orderedAffixesArray: OptimizerCoreSettings['affixesArray'] = new Array(
settings_slots.length,
).fill(affixes);

settings_affixesArray.forEach((_, index) => {
orderedAffixesArray.forEach((_, index) => {
const forcedAffix = forcedSlots[index];

if (forcedAffix || Object.values(exclusions).some((arr) => arr[index])) {
if (forcedAffix) {
settings_affixesArray[index] = [forcedAffix];
orderedAffixesArray[index] = [forcedAffix];
} else {
const filtered = settings_affixesArray[index].filter(
const filtered = orderedAffixesArray[index].filter(
(affix) => !exclusions?.[affix]?.[index],
);
if (filtered.length) {
settings_affixesArray[index] = filtered;
orderedAffixesArray[index] = filtered;
} else {
// user excluded every possible affix; fallback to excluding nothing
}
Expand All @@ -452,7 +452,7 @@ export function createSettingsPerCalculation(
const slotSettingsIdentical = (slotNames: ForcedSlotName[]) => {
const slotIndexes = slotNames.map((slotName) => ForcedSlots.indexOf(slotName));

const slotAffixesArrays = slotIndexes.map((index) => settings_affixesArray[index]);
const slotAffixesArrays = slotIndexes.map((index) => orderedAffixesArray[index]);
const slotAffixesArraysIdentical = arrayEntriesDeepEqual(slotAffixesArrays);

const slotRarities = slotIndexes.map((index) => Object.values(exotics).map((e) => e[index]));
Expand All @@ -473,7 +473,7 @@ export function createSettingsPerCalculation(
// [vipe] glov (forced to viper)
// [grie vipe sini] legs
// ...
settings_affixesArray = settings_affixesArray.map((affixOptions, slotindex) => {
const settings_affixesArray = orderedAffixesArray.map((affixOptions, slotindex) => {
if (affixOptions.length === 1) {
return affixOptions;
}
Expand Down

0 comments on commit 871af2d

Please sign in to comment.