Mercurial > octave
changeset 21665:7b48be706e28
* build-env-features.sh: Emit code to use static variables instead of repeatedly creating new octave_value objects for true and false.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 02 May 2016 18:40:24 -0400 |
parents | 22e7b6ad93b6 |
children | 09517e0a8aa0 |
files | libinterp/build-env-features.sh |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/build-env-features.sh Mon May 02 18:26:50 2016 -0400 +++ b/libinterp/build-env-features.sh Mon May 02 18:40:24 2016 -0400 @@ -33,16 +33,19 @@ if (! initialized) { + static octave_value ov_true = (true); + static octave_value ov_false = (false); + EOF $AWK \ '/#define (OCTAVE_|)HAVE_/ { sub (/(OCTAVE_|)HAVE_/, "", $2); - printf (" m.assign (\"%s\", octave_value (true));\n", $2); + printf (" m.assign (\"%s\", ov_true);\n", $2); } /\/\* #undef (OCTAVE_|)HAVE_/ { sub (/(OCTAVE_|)HAVE_/, "", $3); - printf (" m.assign (\"%s\", octave_value (false));\n", $3); + printf (" m.assign (\"%s\", ov_false);\n", $3); } { }' $conffile | sort