patch 9.1.0168: too many STRLEN() calls
Problem: too many STRLEN() calls
Solution: Make use of ml_get_len() calls instead
(John Marriott)
closes: #14123
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/eval.c b/src/eval.c
index ca5a268..69b8374 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6468,7 +6468,7 @@
if (charcol)
len = (long)mb_charlen(ml_get(pos.lnum));
else
- len = (long)STRLEN(ml_get(pos.lnum));
+ len = (long)ml_get_len(pos.lnum);
// Get the column number
// We accept "$" for the column number: last column.
@@ -6574,7 +6574,7 @@
if (charcol)
pos.col = (colnr_T)mb_charlen(ml_get_curline());
else
- pos.col = (colnr_T)STRLEN(ml_get_curline());
+ pos.col = ml_get_curline_len();
}
return &pos;
}