diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-10 22:11:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-10 22:11:16 +0200 |
commit | 7c0a2f367f2507669560b1a66423155c70d2e75b (patch) | |
tree | 7cd0523311a25f653497197abc1fa86ed62bcc79 /src/ex_cmds.c | |
parent | ea3f2e7be447a8f0c4436869620f908de5e8ef1e (diff) |
patch 7.4.2024v7.4.2024
Problem: More buf_valid() calls can be optimized.
Solution: Use bufref_valid() instead.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 3e29d76892..7ec17b132c 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3666,7 +3666,7 @@ do_ecmd( buf_T *buf; bufref_T bufref; #if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) - buf_T *old_curbuf = curbuf; + bufref_T old_curbuf; #endif char_u *free_fname = NULL; #ifdef FEAT_BROWSE @@ -3691,6 +3691,9 @@ do_ecmd( if (eap != NULL) command = eap->do_ecmd_cmd; +#if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) + set_bufref(&old_curbuf, curbuf); +#endif if (fnum != 0) { @@ -3857,7 +3860,7 @@ do_ecmd( /* autocommands may change curwin and curbuf */ if (oldwin != NULL) oldwin = curwin; - old_curbuf = curbuf; + set_bufref(&old_curbuf, curbuf); #endif } if (buf == NULL) @@ -3875,7 +3878,7 @@ do_ecmd( * buffer. */ if (!bufref_valid(&bufref) #ifdef FEAT_AUTOCMD - || curbuf != old_curbuf + || curbuf != old_curbuf.br_buf #endif ) goto theend; @@ -3934,7 +3937,7 @@ do_ecmd( auto_buf = TRUE; else { - if (curbuf == old_curbuf) + if (curbuf == old_curbuf.br_buf) #endif buf_copy_options(buf, BCO_ENTER); @@ -4196,7 +4199,7 @@ do_ecmd( #if defined(HAS_SWAP_EXISTS_ACTION) if (swap_exists_action == SEA_QUIT) retval = FAIL; - handle_swap_exists(old_curbuf); + handle_swap_exists(&old_curbuf); #endif } #ifdef FEAT_AUTOCMD |