commit: 11e4c9be5892527f03525a05b164c9abf665c715
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 13:44:25 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 21 13:44:25 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11e4c9be
eapi7-ver.eclass: Optimize last suffix comparison
eclass/eapi7-ver.eclass | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass
index 53302631405..4cba67f8491 100644
--- a/eclass/eapi7-ver.eclass
+++ b/eclass/eapi7-ver.eclass
@@ -254,11 +254,9 @@ _ver_compare() {
bs=${bs#*_}
done
if [[ -n ${as} ]]; then
- a=${as%%_*}
- [[ ${a%%[0-9]*} == p ]] && return 3 || return 1
+ [[ ${as} == p[_0-9]* ]] && return 3 || return 1
elif [[ -n ${bs} ]]; then
- b=${bs%%_*}
- [[ ${b%%[0-9]*} == p ]] && return 1 || return 3
+ [[ ${bs} == p[_0-9]* ]] && return 1 || return 3
fi
# Compare revision components (PMS algorithm 3.7)