# HG changeset patch # User Franz Glasner # Date 1724937130 -7200 # Node ID 7e319d23cd8a9cd229971533c9d3b9a18b414fca # Parent 5d43c68bd1e99d847bd6ca0fc6bf4a6c678a09da Docs: warn if the length of arrays are changed while calling array_for_each() diff -r 5d43c68bd1e9 -r 7e319d23cd8a share/local-bsdtools/array.sh --- a/share/local-bsdtools/array.sh Thu Aug 29 15:11:29 2024 +0200 +++ b/share/local-bsdtools/array.sh Thu Aug 29 15:12:10 2024 +0200 @@ -214,6 +214,12 @@ #: $1 (str): The name of an existing array. #: $2 (str): The name of a function to be called with three arguments. #: +#: Warning: +#: If the number of elements changes while being in `array_for_each` then +#: the behaviour is undefined. +#: The current implementation determines the length of the array once +#: at the start of execution. +#: array_for_each() { local _name _cb