Skip to content

Commit

Permalink
Moved out of a loop some (redundant) computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryberger committed Aug 9, 2019
1 parent 1ead653 commit 0ac275a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/groupme.js
Expand Up @@ -186,10 +186,10 @@ function find_all_proposed_fixes(grouped_formulas) {
var all_matches = [];
var count = 0;
rectangles_count = 0;
var aNum = {};
fix_grouped_formulas(grouped_formulas, aNum);
for (var _i = 0, _a = Object.keys(grouped_formulas); _i < _a.length; _i++) {
var key = _a[_i];
var aNum = {};
fix_grouped_formulas(grouped_formulas, aNum);
for (var i = 0; i < aNum[key].length; i++) {
var matches = find_all_matching_rectangles(key, aNum[key][i], aNum);
all_matches = all_matches.concat(matches);
Expand Down
4 changes: 2 additions & 2 deletions src/components/groupme.ts
Expand Up @@ -208,9 +208,9 @@ export function find_all_proposed_fixes(grouped_formulas : { [val: string]: Arra
let all_matches = [];
let count = 0;
rectangles_count = 0;
let aNum = {};
fix_grouped_formulas(grouped_formulas, aNum);
for (let key of Object.keys(grouped_formulas)) {
let aNum = {};
fix_grouped_formulas(grouped_formulas, aNum);
for (let i = 0; i < aNum[key].length; i++) {
const matches = find_all_matching_rectangles(key, aNum[key][i], aNum);
all_matches = all_matches.concat(matches);
Expand Down

0 comments on commit 0ac275a

Please sign in to comment.