From a74901929e999a0052c1ce388ab09359c10cbb0d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 22 Jul 2021 12:26:14 +0200 Subject: patch 8.2.3199: Vim9: execution speed can be improved Problem: Vim9: execution speed can be improved. Solution: Make the break counter static. --- src/vim9execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vim9execute.c') diff --git a/src/vim9execute.c b/src/vim9execute.c index 32e52ac39..6cc1fc7e9 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1526,8 +1526,6 @@ handle_debug(isn_T *iptr, ectx_T *ectx) 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 @@ exec_instructions(ectx_T *ectx) for (;;) { + static int breakcheck_count = 0; // using "static" makes it faster isn_T *iptr; + typval_T *tv; if (++breakcheck_count >= 100) { -- cgit v1.2.1