summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-10 22:11:16 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-10 22:11:16 +0200
commit7c0a2f367f2507669560b1a66423155c70d2e75b (patch)
tree7cd0523311a25f653497197abc1fa86ed62bcc79 /src/main.c
parentea3f2e7be447a8f0c4436869620f908de5e8ef1e (diff)
downloadvim-git-7c0a2f367f2507669560b1a66423155c70d2e75b.tar.gz
patch 7.4.2024v7.4.2024
Problem: More buf_valid() calls can be optimized. Solution: Use bufref_valid() instead.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 42638e448..26941bd6e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);