Skip to content

Commit

Permalink
fix: sort array by length after reading so substrings aren't shadowed
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy committed Jul 13, 2019
1 parent 7d8f47f commit 8b5a5b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const loadCSVFile = () => {
lines.pop();
}

// Some mappings are substrings of other mappings, transform longest mappings first
lines.sort(function(a, b){
return b.length - a.length;
});

return lines;
};

Expand Down

0 comments on commit 8b5a5b3

Please sign in to comment.