summaryrefslogtreecommitdiff
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorPaul Ollis <paul@cleversheep.org>2022-06-05 16:55:54 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-05 16:55:54 +0100
commit6574577cacd393ab7591fc776ea060eebc939e55 (patch)
treef583ca9957280e7086b8d14ef44127302829fd40 /src/ex_getln.c
parent1d97db3d987c05af88c30ad20f537bcf3024f9c1 (diff)
downloadvim-git-6574577cacd393ab7591fc776ea060eebc939e55.tar.gz
patch 8.2.5057: using gettimeofday() for timeout is very inefficientv8.2.5057
Problem: Using gettimeofday() for timeout is very inefficient. Solution: Set a platform dependent timer. (Paul Ollis, closes #10505)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index f75d8c7a9..20d9520ed 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -417,7 +417,6 @@ may_do_incsearch_highlighting(
int found; // do_search() result
pos_T end_pos;
#ifdef FEAT_RELTIME
- proftime_T tm;
searchit_arg_T sia;
#endif
int next_char;
@@ -484,10 +483,6 @@ may_do_incsearch_highlighting(
cursor_off(); // so the user knows we're busy
out_flush();
++emsg_off; // so it doesn't beep if bad expr
-#ifdef FEAT_RELTIME
- // Set the time limit to half a second.
- profile_setlimit(500L, &tm);
-#endif
if (!p_hls)
search_flags += SEARCH_KEEP;
if (search_first_line != 0)
@@ -495,7 +490,8 @@ may_do_incsearch_highlighting(
ccline.cmdbuff[skiplen + patlen] = NUL;
#ifdef FEAT_RELTIME
CLEAR_FIELD(sia);
- sia.sa_tm = &tm;
+ // Set the time limit to half a second.
+ sia.sa_tm = 500;
#endif
found = do_search(NULL, firstc == ':' ? '/' : firstc, search_delim,
ccline.cmdbuff + skiplen, count, search_flags,