Simplify uniqueList
This commit is contained in:
parent
75369656ed
commit
813b6b2c84
1 changed files with 1 additions and 9 deletions
|
@ -97,15 +97,7 @@ class common extends utils {
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
static uniqueList (list) {
|
static uniqueList (list) {
|
||||||
let tmp = {}
|
return list.filter((v, i, a) => a.indexOf(v) === i)
|
||||||
let r = []
|
|
||||||
for (let i = 0; i < list.length; i++) {
|
|
||||||
tmp[list[i]] = list[i]
|
|
||||||
}
|
|
||||||
for (let i in tmp) {
|
|
||||||
r.push(tmp[i])
|
|
||||||
}
|
|
||||||
return r
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue