]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0146: dictionary lookups can be improved v9.2.0146
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Thu, 12 Mar 2026 19:26:01 +0000 (19:26 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 12 Mar 2026 19:26:01 +0000 (19:26 +0000)
Problem:  dictionary lookups can be improved
Solution: Replace the vim_strncpy() by mch_memmove() call.
          (Yasuhiro Matsumoto).

closes: #19646

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/dict.c
src/version.c

index 2b3ef889718151499dbda885e5db03a32a530393..aea40b33897a6c80100e4ab292a9403fd184d43c 100644 (file)
@@ -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;
     }
 
index da639bb067c0ec528d98eedcb38f28f7e6c57383..baf369ca1b56c822c2bdb3f5c3913980ceceb3ef 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    146,
 /**/
     145,
 /**/