From 137f8a58a8f2a6c356ef00e5371ff144c8a89fb0 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Sun, 17 Sep 2017 02:32:05 +0200 Subject: Move Variant::evaluate() switch to computed goto In an effort to make GDScript a little faster replace the double switch() with a computed goto on compilers that set __GNUC__. For compilers that don't support computed goto it will fall back to regular switch/case statements. In addition disable using boolean values in a mathematical context. Now boolean values can only be compared with other booleans. Booleans will also no longer be coerced to integers. This PR replaces #11308 and fixes #11291 --- modules/visual_script/visual_script_func_nodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/visual_script/visual_script_func_nodes.cpp') diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 267946750f..f02e797fe6 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -1546,7 +1546,7 @@ public: value = Variant::evaluate(Variant::OP_ADD, value, p_argument); } break; case VisualScriptPropertySet::ASSIGN_OP_SUB: { - value = Variant::evaluate(Variant::OP_SUBSTRACT, value, p_argument); + value = Variant::evaluate(Variant::OP_SUBTRACT, value, p_argument); } break; case VisualScriptPropertySet::ASSIGN_OP_MUL: { value = Variant::evaluate(Variant::OP_MULTIPLY, value, p_argument); -- cgit v1.2.3