patch 8.2.3199: Vim9: execution speed can be improved
Problem: Vim9: execution speed can be improved.
Solution: Make the break counter static.
diff --git a/src/version.c b/src/version.c
index 631c122..cd0f9ec 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3199,
+/**/
3198,
/**/
3197,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 32e52ac..6cc1fc7 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1526,8 +1526,6 @@
static int
exec_instructions(ectx_T *ectx)
{
- int breakcheck_count = 0;
- typval_T *tv;
int ret = FAIL;
int save_trylevel_at_start = ectx->ec_trylevel_at_start;
@@ -1539,7 +1537,9 @@
for (;;)
{
+ static int breakcheck_count = 0; // using "static" makes it faster
isn_T *iptr;
+ typval_T *tv;
if (++breakcheck_count >= 100)
{