Skip to content

Commit

Permalink
fix: deduplicate redundant work (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored Aug 18, 2020
1 parent ec765db commit b89651c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/zoe/src/contractSupport/zoeHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const getKeysSorted = obj =>

/**
* Given toGains (an AmountKeywordRecord), and allocations (a pair,
* 'to' and 'from', of AmountKeywordRecords), all the entries in
* 'to' and 'from', of Allocations), all the entries in
* toGains will be added to 'to'. If fromLosses is defined, all the
* entries in fromLosses are subtracted from 'from'. (If fromLosses
* is not defined, toGains is subtracted from 'from'.)
Expand Down Expand Up @@ -67,10 +67,7 @@ const calcNewAllocations = (
],
);

const allToKeywords = [
...Object.keys(toGains),
...Object.keys(allocations.to),
];
const allToKeywords = Object.keys({ ...allocations.to, ...toGains });

const newToAllocation = Object.fromEntries(
allToKeywords.map(keyword => [
Expand Down

0 comments on commit b89651c

Please sign in to comment.