commit b2011bae3eecd5da1dbc0a228cccaa37ead029a9
parent b15f7007ebd2681f08d742dcff8e371bcb47ec27
Author: Lewis Russell <lewis6991@gmail.com>
Date: Mon, 24 Oct 2022 14:21:37 +0100
refactor(diff.c): simplify diff_buf_idx()
Diffstat:
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
@@ -211,13 +211,7 @@ static void diff_buf_clear(void)
/// @return Its index or DB_COUNT if not found.
static int diff_buf_idx(buf_T *buf)
{
- int idx;
- for (idx = 0; idx < DB_COUNT; idx++) {
- if (curtab->tp_diffbuf[idx] == buf) {
- break;
- }
- }
- return idx;
+ return diff_buf_idx_tp(buf, curtab);
}
/// Find buffer "buf" in the list of diff buffers for tab page "tp".