This commit is contained in:
Jephte CLAIN 2014-01-18 23:06:46 +04:00
parent 287c4a7bac
commit aafca0172d
1 changed files with 7 additions and 7 deletions

View File

@ -518,13 +518,13 @@ function array_fillrange() {
}
function array_eq() {
# tester l'égalité des tableaux $1 et $2
local __ae_c1="#$1[*]" __ae_c2="#$2[*]"
[ ${!__ae_c1} -eq ${!__ae_c2} ] || return 1
local __ae_v1s="$1[@]" __ae_v1
local __ae_v2 __ae_i=0
for __ae_v1 in "${!__ae_v1s}"; do
__ae_v2="$2[$__ae_i]"
[ "$__ae_v1" == "${!__ae_v2}" ] || return 1
local -a __ae_a1 __ae_a2
array_copy __ae_a1 "$1"
array_copy __ae_a2 "$2"
[ ${#__ae_a1[*]} -eq ${#__ae_a2[*]} ] || return 1
local __ae_v __ae_i=0
for __ae_v in "${__ae_a1[@]}"; do
[ "$__ae_v" == "${__ae_a2[$__ae_i]}" ] || return 1
__ae_i=$(($__ae_i + 1))
done
return 0