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>
This commit is contained in:
committed by
Christian Brabandt
parent
066a5340e3
commit
f4b36417e8
@ -1429,11 +1429,13 @@ change_indent(
|
||||
ptr = alloc(i + 1);
|
||||
if (ptr != NULL)
|
||||
{
|
||||
size_t ptrlen;
|
||||
new_cursor_col += i;
|
||||
ptr[i] = NUL;
|
||||
ptrlen = i;
|
||||
while (--i >= 0)
|
||||
ptr[i] = ' ';
|
||||
ins_str(ptr);
|
||||
ins_str(ptr, ptrlen);
|
||||
vim_free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user