Skip to content

Commit

Permalink
Rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 2, 2022
1 parent ddf6101 commit dceb09f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/history/normalize/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export const loadRawResults = function (rawResults) {
// Normalize the history and target results after load, once the target result
// is known
export const normalizeRawResults = function (targetResult, history, config) {
const historyA = mergeResults([...history, targetResult])
const [historyB, targetResultA] = pickLast(historyA)
const historyC = addDefaultIds(historyB, targetResultA)
const historyD = filterUnusedCombinations(historyC, targetResultA)
const [targetResultB, ...historyE] = [targetResultA, ...historyD].map(
const rawResults = mergeResults([...history, targetResult])
const [historyA, targetResultA] = pickLast(rawResults)
const historyB = addDefaultIds(historyA, targetResultA)
const historyC = filterUnusedCombinations(historyB, targetResultA)
const [targetResultB, ...historyD] = [targetResultA, ...historyC].map(
(rawResult) => normalizeRawResult(rawResult, config),
)
validateSelectMatches(targetResultB, config)
return { targetResult: targetResultB, history: historyE }
return { targetResult: targetResultB, history: historyD }
}

// We ignore the combinations from history results that do not exist in the
Expand Down
4 changes: 2 additions & 2 deletions src/system/merge/results.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Merge all results with the same `mergeId`
export const mergeResults = function (history) {
return history
export const mergeResults = function (rawResults) {
return rawResults
}

0 comments on commit dceb09f

Please sign in to comment.