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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user