0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.2024

Problem:    More buf_valid() calls can be optimized.
Solution:   Use bufref_valid() instead.
This commit is contained in:
Bram Moolenaar
2016-07-10 22:11:16 +02:00
parent ea3f2e7be4
commit 7c0a2f367f
21 changed files with 218 additions and 133 deletions

View File

@@ -1460,9 +1460,13 @@ getout(int exitval)
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
if (buf->b_ml.ml_mfp != NULL)
{
bufref_T bufref;
set_bufref(&bufref, buf);
apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname,
FALSE, buf);
if (!buf_valid(buf)) /* autocmd may delete the buffer */
if (!bufref_valid(&bufref))
/* autocmd deleted the buffer */
break;
}
apply_autocmds(EVENT_VIMLEAVEPRE, NULL, NULL, FALSE, curbuf);