patch 9.1.1137: ins_str() is inefficient by calling STRLEN()
Problem: ins_str() is inefficient by calling STRLLEN()
Solution: refactor ins_str() to take a length argument
and let all callers provide the correct length
when calling ins_str() (John Marriott)
closes: #16711
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/textformat.c b/src/textformat.c
index 77e3eef..018565f 100644
--- a/src/textformat.c
+++ b/src/textformat.c
@@ -434,7 +434,7 @@
// add the additional whitespace needed after the
// comment leader for the numbered list.
for (i = 0; i < padding; i++)
- ins_str((char_u *)" ");
+ ins_str((char_u *)" ", 1);
}
else
{