]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3199: Vim9: execution speed can be improved v8.2.3199
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Jul 2021 10:26:14 +0000 (12:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Jul 2021 10:26:14 +0000 (12:26 +0200)
Problem:    Vim9: execution speed can be improved.
Solution:   Make the break counter static.

src/version.c
src/vim9execute.c

index 631c1220019d4ec89fb0e856ba7ef97d19b8e32d..cd0f9ec385c279d4c34ba8ec542b59f636d07a1b 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3199,
 /**/
     3198,
 /**/
index 32e52ac390763488a4f3181b9dd84ba0ccadac2a..6cc1fc7e9f7913bcd129a935d1fdecb2e7e53688 100644 (file)
@@ -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)
        {