[MPlayer-cvslog] r38350 - trunk/configure
reimar
subversion at mplayerhq.hu
Sun Feb 27 11:09:00 EET 2022
Author: reimar
Date: Sun Feb 27 11:09:00 2022
New Revision: 38350
Log:
configure: optimize using 'case' instead of 'grep'.
Faster in general, but especially on Windows where
it results in a 2x to 3x speedup overall.
Modified:
trunk/configure
Modified: trunk/configure
==============================================================================
--- trunk/configure Sun Feb 27 11:03:21 2022 (r38349)
+++ trunk/configure Sun Feb 27 11:09:00 2022 (r38350)
@@ -8616,16 +8616,15 @@ fi
mak_enable () {
list=$(echo $1 | toupper)
-item=$(echo $2 | toupper)
+item=" $(echo $2 | toupper) "
nprefix=$3;
suffix=$4
for part in $list; do
name="${nprefix}_${part}$suffix"
- if $(echo $item | grep -q -E "(^| )$part($| )"); then
- echo "$name = yes"
- else
- echo "!$name = yes"
- fi
+ case "$item" in
+ *" $part "*) echo "$name = yes" ;;
+ *) echo "!$name = yes" ;;
+ esac
done
}
@@ -9065,17 +9064,16 @@ EOF
ff_config_enable () {
list=$(echo $1 | toupper)
-item=$(echo $2 | toupper)
+item=" $(echo $2 | toupper) "
_nprefix=$4;
_defineprefix=$3;
_postfix=$5;
test -z "$_nprefix" && _nprefix='CONFIG'
for part in $list; do
- if $(echo $item | grep -q -E "(^| )$part($| )"); then
- echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 1"
- else
- echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 0"
- fi
+ case "$item" in
+ *" $part "*) echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 1" ;;
+ *) echo "${_defineprefix}define ${_nprefix}_${part}${_postfix} 0" ;;
+ esac
done
}
More information about the MPlayer-cvslog
mailing list