]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Optimize f_sprintf() for bash
authordteske <dteske@FreeBSD.org>
Sun, 31 Jan 2016 21:22:10 +0000 (21:22 +0000)
committerdteske <dteske@FreeBSD.org>
Sun, 31 Jan 2016 21:22:10 +0000 (21:22 +0000)
commit089e1927c5f216d8771aed2b3c7cd3fb97a84663
tree900203a02f87d4b43974d2bf1ff37a557ec52745
parent37617f7cb005082f23a6727fb7fdf8740ea668d9
Optimize f_sprintf() for bash

bash lacks the ksh93 optimization that makes sub-shells fast if they do
not alter io. bash 3.1-alpha1 introduced printf -v var_to_set which is not
as fast but is still significantly faster than var_to_set=$( printf ) when
using any version of bash. If we find our interpreter to somehow be bash
by invocation or inclusion, use the feature that provides fastest results.
usr.sbin/bsdconfig/share/strings.subr