diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-13 05:43:31 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-13 19:25:40 -0500 |
commit | c2ceed49947c8266e2fdfbf596dab23dd3d39279 (patch) | |
tree | 62cb56ff838413cc32cf0ae6035d46245f648190 /src | |
parent | 6989ac05f45f2c3c9539522272fd2c73960fa134 (diff) | |
download | rneovim-c2ceed49947c8266e2fdfbf596dab23dd3d39279.tar.gz rneovim-c2ceed49947c8266e2fdfbf596dab23dd3d39279.tar.bz2 rneovim-c2ceed49947c8266e2fdfbf596dab23dd3d39279.zip |
quickfix: fix dead assignment
Cherry-picked from vim patch 8.1.1489.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/quickfix.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 276427f216..ed57b28029 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -4559,9 +4559,9 @@ static qfline_T *qf_find_closest_entry(qf_list_T *qfl, /// Get the nth quickfix entry below the specified entry treating multiple /// entries on a single line as one. Searches forward in the list. -static qfline_T *qf_get_nth_below_entry(qfline_T *entry, - int *errornr, - linenr_T n) +static void qf_get_nth_below_entry(qfline_T *entry, + int *errornr, + linenr_T n) { while (n-- > 0 && !got_int) { qfline_T *first_entry = entry; @@ -4582,15 +4582,13 @@ static qfline_T *qf_get_nth_below_entry(qfline_T *entry, entry = entry->qf_next; (*errornr)++; } - - return entry; } /// Get the nth quickfix entry above the specified entry treating multiple /// entries on a single line as one. Searches backwards in the list. -static qfline_T *qf_get_nth_above_entry(qfline_T *entry, - int *errornr, - linenr_T n) +static void qf_get_nth_above_entry(qfline_T *entry, + int *errornr, + linenr_T n) { while (n-- > 0 && !got_int) { if (entry->qf_prev == NULL @@ -4604,8 +4602,6 @@ static qfline_T *qf_get_nth_above_entry(qfline_T *entry, // If multiple entries are on the same line, then use the first entry entry = qf_find_first_entry_on_line(entry, errornr); } - - return entry; } /// Find the n'th quickfix entry adjacent to line 'lnum' in buffer 'bnr' in the @@ -4629,9 +4625,9 @@ static int qf_find_nth_adj_entry(qf_list_T *qfl, if (--n > 0) { // Go to the n'th entry in the current buffer if (dir == FORWARD) { - adj_entry = qf_get_nth_below_entry(adj_entry, &errornr, n); + qf_get_nth_below_entry(adj_entry, &errornr, n); } else { - adj_entry = qf_get_nth_above_entry(adj_entry, &errornr, n); + qf_get_nth_above_entry(adj_entry, &errornr, n); } } |