Suggested by Eli Schwartz. This gives roughly 5260 ops / s, over 550%
speedup.
The complete patch series therefore increases the speed from roughly
326 ops / s to 5260 ops / s, making the common case 16 times faster.
Closes:
https://bugs.gentoo.org/908411
Closes:
https://github.com/gentoo/gentoo/pull/31404
Signed-off-by: Michał Górny <
[email protected]>
---
eclass/pypi.eclass | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/eclass/pypi.eclass b/eclass/pypi.eclass
index eade3d955ab5..618fde5e3de8 100644
--- a/eclass/pypi.eclass
+++ b/eclass/pypi.eclass
@@ -71,10 +71,13 @@ _PYPI_ECLASS=1
# via _PYPI_NORMALIZED_NAME variable.
_pypi_normalize_name() {
local name=${1}
- local shopt_save=$(shopt -p extglob)
- shopt -s extglob
+ local prev_extglob=-s
+ if ! shopt -p extglob >/dev/null; then
+ prev_extglob=-u
+ shopt -s extglob
+ fi
name=${name//+([._-])/_}
- ${shopt_save}
+ shopt "${prev_extglob}" extglob
_PYPI_NORMALIZED_NAME="${name,,}"
}
--
2.41.0
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)