Skip to content

Commit

Permalink
fix for long processing time of data-utils::unique (#1592)
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Dykhta <igorDykhta@users.noreply.github.com>

Co-authored-by: Igor Dykhta <igorDykhta@users.noreply.github.com>
  • Loading branch information
heshan0131 and igorDykhta committed Aug 30, 2021
1 parent 91a52b1 commit 1b5e023
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/data-utils.js
Expand Up @@ -38,12 +38,12 @@ const MIN_LONGITUDE = -180;
*/
export function unique(values) {
const results = [];
values.forEach(v => {
if (!results.includes(v) && notNullorUndefined(v)) {
const uniqueSet = new Set(values);
uniqueSet.forEach(v => {
if (notNullorUndefined(v)) {
results.push(v);
}
});

return results;
}

Expand Down

0 comments on commit 1b5e023

Please sign in to comment.