1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 07:27:58 +01:00

More of the last commit, and fix :set WRT scoping.

This commit is contained in:
Kris Maglione
2008-10-08 06:09:39 +00:00
parent 12e1b2e89e
commit 796d054306
3 changed files with 53 additions and 53 deletions

View File

@@ -368,14 +368,23 @@ liberator.util = { //{{{
return urls;
},
uniq: function (ary)
uniq: function (ary, unsorted)
{
let ret = [];
for (let [,item] in Iterator(ary.sort()))
if (unsorted)
{
if (item != last || !ret.length)
ret.push(item);
var last = item;
for (let [, item] in Iterator(ary))
if (ret.indexOf(item) == -1)
ret.push(item);
}
else
{
for (let [,item] in Iterator(ary.sort()))
{
if (item != last || !ret.length)
ret.push(item);
var last = item;
}
}
return ret;
},