Category talk:Wren-seq: Difference between revisions
→Source code: Added Lst.prune method.
m (→Source code: Minor change.) |
(→Source code: Added Lst.prune method.) |
||
Line 270:
for (g in gr) res.add(g[0])
return res
}
// Removes consecutive repeated elements from a list (not a copy).
// If the list is sorted, it removes all duplicates.
static prune(a) {
isList_(a)
var c = a.count
if (c < 2) return
for (i in c-1..1) {
if (a[i-1] == a[i]) a.removeAt(i)
}
}
|