From b2011bae3eecd5da1dbc0a228cccaa37ead029a9 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 24 Oct 2022 14:21:37 +0100 Subject: refactor(diff.c): simplify diff_buf_idx() --- src/nvim/diff.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 5069d30e46..a12dfdd9b2 100644 --- 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". -- cgit