From 3a1515bfee59710b4da9bfdf0fc4ecb5b13a00db Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 3 Jun 2024 05:38:06 +0800 Subject: vim-patch:partial:9.1.0461: too many strlen() calls in drawline.c (#29150) Problem: too many strlen() calls in drawline.c Solution: Refactor code to avoid strlen() (John Marriott) closes: vim/vim#14890 https://github.com/vim/vim/commit/f51ff96532ab8f97f779b44d17dccdda9d8ce566 Co-authored-by: John Marriott --- src/nvim/drawline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 3bd00ee3f9..4247705896 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1422,7 +1422,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s line = ml_get_buf(wp->w_buffer, lnum); ptr = line + linecol; - if (len == 0 || (int)wp->w_cursor.col > ptr - line) { + if (len == 0 || wp->w_cursor.col > linecol) { // no bad word found at line start, don't check until end of a // word spell_hlf = HLF_COUNT; -- cgit