docs: fix doc comments in arrays too

This commit is contained in:
Delyan Angelov 2025-07-02 17:06:21 +03:00
parent 74b6e3b5c7
commit 35af6a8d12
7 changed files with 49 additions and 59 deletions

View file

@ -19,9 +19,8 @@ fn limited_workers(max_workers int, ilen int) int {
return workers
}
// run lets the user run an array of input with a
// user provided function in parallel. It limits the number of
// worker threads to min(num_workers, num_cpu)
// run lets the user run an array of input with a user provided function in parallel.
// It limits the number of worker threads to min(num_workers, num_cpu).
// The function aborts if an error is encountered.
// Example: parallel.run([1, 2, 3, 4, 5], 2, fn (i) { println(i) })
pub fn run[T](input []T, worker fn (T), opt Params) {
@ -58,9 +57,8 @@ struct Task[T, R] {
result R
}
// amap lets the user run an array of input with a
// user provided function in parallel. It limits the number of
// worker threads to max number of cpus.
// amap lets the user run an array of input with a user provided function in parallel.
// It limits the number of worker threads to max number of cpus.
// The worker function can return a value. The returning array maintains the input order.
// Any error handling should have happened within the worker function.
// Example: squares := parallel.amap([1, 2, 3, 4, 5], 2, fn (i) { return i * i })