patch 9.2.0146: dictionary lookups can be improved
Commit:
https://github.com/vim/vim/commit/97a75d835b5b8321b1055852b4870496bf6eba60
Author: Yasuhiro Matsumoto <[email protected]>
Date: Thu Mar 12 19:26:01 2026 +0000
patch 9.2.0146: dictionary lookups can be improved
Problem: dictionary lookups can be improved
Solution: Replace the vim_strncpy() by mch_memmove() call.
(Yasuhiro Matsumoto).
closes: #19646
Signed-off-by: Yasuhiro Matsumoto <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/dict.c b/src/dict.c
index 2b3ef8897..aea40b338 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -668,7 +668,8 @@ dict_find(dict_T *d, char_u *key, int len)
else
{
// Avoid a malloc/free by using buf[].
- vim_strncpy(buf, key, len);
+ mch_memmove(buf, key, (size_t)len);
+ buf[len] = NUL;
akey = buf;
}
diff --git a/src/version.c b/src/version.c
index da639bb06..baf369ca1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 146,
/**/
145,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1w0ljQ-002C86-GA%40256bit.org.