summaryrefslogtreecommitdiff
path: root/src/lib/container/array/array.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/container/array/array.go')
-rw-r--r--src/lib/container/array/array.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/container/array/array.go b/src/lib/container/array/array.go
index 768e46d3a..e29736fb6 100644
--- a/src/lib/container/array/array.go
+++ b/src/lib/container/array/array.go
@@ -140,6 +140,13 @@ func (p *Array) Slice(i, j int) *Array {
}
+func (p *Array) Do(f func(elem Element)) {
+ for i := 0; i < len(p.a); i++ {
+ f(p.a[i]) // not too safe if f changes the Array
+ }
+}
+
+
// Convenience wrappers
func (p *Array) Push(x Element) {