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}
|
||||
*/
|
||||
static uniqueList (list) {
|
||||
let tmp = {}
|
||||
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
|
||||
return list.filter((v, i, a) => a.indexOf(v) === i)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue