refactor: don't rebuild the whole recycler object
This commit is contained in:
parent
0085c22003
commit
347844610c
1 changed files with 4 additions and 11 deletions
|
|
@ -171,17 +171,10 @@ function plugins (settings, deviceId) {
|
|||
throw new Error('Negative note count: %j', counts)
|
||||
}
|
||||
|
||||
const computedRecyclers = []
|
||||
_.forEach(it => {
|
||||
computedRecyclers.push({
|
||||
number: recyclers[it].number,
|
||||
name: recyclers[it].name,
|
||||
denomination: recyclers[it].denomination,
|
||||
count: counts[it]
|
||||
})
|
||||
}, _.times(_.identity(), _.size(recyclers)))
|
||||
|
||||
return computedRecyclers
|
||||
return _.map(
|
||||
recycler => _.set('count', counts[recycler.number], recycler),
|
||||
recyclers
|
||||
)
|
||||
}
|
||||
|
||||
function buildAvailableCassettes (excludeTxId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue