Mercurial > vim
comparison src/tag.c @ 28057:bfa81ded42e2 v8.2.4553
patch 8.2.4553: linear tag search is a bit slow
Commit: https://github.com/vim/vim/commit/8b530b3158cbd3aee2ad9cad8e7b7964faabb51e
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat Mar 12 17:38:29 2022 +0000
patch 8.2.4553: linear tag search is a bit slow
Problem: Linear tag search is a bit slow.
Solution: Remove a vim_ftell() call. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/9937)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 12 Mar 2022 18:45:03 +0100 |
parents | 0362ab7c1a02 |
children | a1914b89f0b7 |
comparison
equal
deleted
inserted
replaced
28056:fa0290f89c7b | 28057:bfa81ded42e2 |
---|---|
2090 #ifdef FEAT_CSCOPE | 2090 #ifdef FEAT_CSCOPE |
2091 if (st->flags & TAG_CSCOPE) | 2091 if (st->flags & TAG_CSCOPE) |
2092 eof = cs_fgets(st->lbuf, st->lbuf_size); | 2092 eof = cs_fgets(st->lbuf, st->lbuf_size); |
2093 else | 2093 else |
2094 #endif | 2094 #endif |
2095 { | |
2096 sinfo_p->curr_offset = vim_ftell(st->fp); | |
2097 eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp); | 2095 eof = vim_fgets(st->lbuf, st->lbuf_size, st->fp); |
2098 } | |
2099 } while (!eof && vim_isblankline(st->lbuf)); | 2096 } while (!eof && vim_isblankline(st->lbuf)); |
2100 | 2097 |
2101 if (eof) | 2098 if (eof) |
2102 { | 2099 { |
2103 #ifdef FEAT_EMACS_TAGS | 2100 #ifdef FEAT_EMACS_TAGS |
2848 st->fp = NULL; | 2845 st->fp = NULL; |
2849 st->stop_searching = TRUE; | 2846 st->stop_searching = TRUE; |
2850 return; | 2847 return; |
2851 } | 2848 } |
2852 | 2849 |
2853 if (st->state == TS_STEP_FORWARD) | 2850 if (st->state == TS_STEP_FORWARD || st->state == TS_LINEAR) |
2854 // Seek to the same position to read the same line again | 2851 // Seek to the same position to read the same line again |
2855 vim_ignored = vim_fseek(st->fp, search_info.curr_offset, | 2852 vim_ignored = vim_fseek(st->fp, search_info.curr_offset, |
2856 SEEK_SET); | 2853 SEEK_SET); |
2857 // this will try the same thing again, make sure the offset is | 2854 // this will try the same thing again, make sure the offset is |
2858 // different | 2855 // different |