# HG changeset patch # User John W. Eaton # Date 1462228824 14400 # Node ID 7b48be706e28fab265b369e62209e0c4252a23a6 # Parent 22e7b6ad93b60634fdcfe98ae22cada7dad02284 * build-env-features.sh: Emit code to use static variables instead of repeatedly creating new octave_value objects for true and false. diff -r 22e7b6ad93b6 -r 7b48be706e28 libinterp/build-env-features.sh --- 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