Simplify uniqueList

This commit is contained in:
pyoor 2018-08-29 18:06:27 -04:00
parent 75369656ed
commit 813b6b2c84

View file

@ -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
} }
/** /**