summaryrefslogtreecommitdiffstats
path: root/src/diff.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/diff.c
parentea3f2e7be447a8f0c4436869620f908de5e8ef1e (diff)
patch 7.4.2024v7.4.2024
Problem: More buf_valid() calls can be optimized. Solution: Use bufref_valid() instead.
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/diff.c b/src/diff.c
index 5e17943ec5..287f434bee 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1069,8 +1069,9 @@ theend:
ex_diffsplit(exarg_T *eap)
{
win_T *old_curwin = curwin;
- buf_T *old_curbuf = curbuf;
+ bufref_T old_curbuf;
+ set_bufref(&old_curbuf, curbuf);
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
#endif
@@ -1092,10 +1093,10 @@ ex_diffsplit(exarg_T *eap)
{
diff_win_options(old_curwin, TRUE);
- if (buf_valid(old_curbuf))
+ if (bufref_valid(&old_curbuf))
/* Move the cursor position to that of the old window. */
curwin->w_cursor.lnum = diff_get_corresponding_line(
- old_curbuf,
+ old_curbuf.br_buf,
old_curwin->w_cursor.lnum,
curbuf,
curwin->w_cursor.lnum);
@@ -1557,7 +1558,8 @@ diff_check(win_T *wp, linenr_T lnum)
/* Compare all lines. If they are equal the lines were inserted
* in some buffers, deleted in others, but not changed. */
for (i = 0; i < DB_COUNT; ++i)
- if (i != idx && curtab->tp_diffbuf[i] != NULL && dp->df_count[i] != 0)
+ if (i != idx && curtab->tp_diffbuf[i] != NULL
+ && dp->df_count[i] != 0)
if (!diff_equal_entry(dp, idx, i))
return -1;
}