commit: 67ea3f75ef3e92cba1f33e1df36d6e53211251f0
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 12 22:28:16 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec 22 22:12:23 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67ea3f75
python-any-r1.eclass: Use reverse iter instead of reversing impls array
eclass/python-any-r1.eclass | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 99aac73..c6dfc9c 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -313,13 +313,9 @@ python_setup() {
done
# fallback to best installed impl.
- local rev_impls=()
- for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
- rev_impls=( "${i}" "${rev_impls[@]}" )
- done
-
- for i in "${rev_impls[@]}"; do
- python_export "${i}" EPYTHON PYTHON
+ # (reverse iteration over _PYTHON_SUPPORTED_IMPLS)
+ for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do
+ python_export "${_PYTHON_SUPPORTED_IMPLS[i]}" EPYTHON PYTHON
if _python_EPYTHON_supported "${EPYTHON}"; then
python_wrapper_setup
return