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)
|
throw new Error('Negative note count: %j', counts)
|
||||||
}
|
}
|
||||||
|
|
||||||
const computedRecyclers = []
|
return _.map(
|
||||||
_.forEach(it => {
|
recycler => _.set('count', counts[recycler.number], recycler),
|
||||||
computedRecyclers.push({
|
recyclers
|
||||||
number: recyclers[it].number,
|
)
|
||||||
name: recyclers[it].name,
|
|
||||||
denomination: recyclers[it].denomination,
|
|
||||||
count: counts[it]
|
|
||||||
})
|
|
||||||
}, _.times(_.identity(), _.size(recyclers)))
|
|
||||||
|
|
||||||
return computedRecyclers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAvailableCassettes (excludeTxId) {
|
function buildAvailableCassettes (excludeTxId) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue