0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -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

@@ -1173,9 +1173,12 @@ free_all_mem(void)
#endif
for (buf = firstbuf; buf != NULL; )
{
bufref_T bufref;
set_bufref(&bufref, buf);
nextbuf = buf->b_next;
close_buffer(NULL, buf, DOBUF_WIPE, FALSE);
if (buf_valid(buf))
if (bufref_valid(&bufref))
buf = nextbuf; /* didn't work, try next one */
else
buf = firstbuf;