Skip to content

Commit a749019

Browse files
committed
patch 8.2.3199: Vim9: execution speed can be improved
Problem: Vim9: execution speed can be improved. Solution: Make the break counter static.
1 parent f674b35 commit a749019

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3199,
758760
/**/
759761
3198,
760762
/**/

src/vim9execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,6 @@ handle_debug(isn_T *iptr, ectx_T *ectx)
15261526
static int
15271527
exec_instructions(ectx_T *ectx)
15281528
{
1529-
int breakcheck_count = 0;
1530-
typval_T *tv;
15311529
int ret = FAIL;
15321530
int save_trylevel_at_start = ectx->ec_trylevel_at_start;
15331531

@@ -1539,7 +1537,9 @@ exec_instructions(ectx_T *ectx)
15391537

15401538
for (;;)
15411539
{
1540+
static int breakcheck_count = 0; // using "static" makes it faster
15421541
isn_T *iptr;
1542+
typval_T *tv;
15431543

15441544
if (++breakcheck_count >= 100)
15451545
{

0 commit comments

Comments
 (0)