diff src/misc1.c @ 15308:d7a8f390f6d2 v8.1.0662

patch 8.1.0662: needlessly searching for tilde in string commit https://github.com/vim/vim/commit/ef0a1d5ed3566b91143d30ae9de3240f47c6e282 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 30 11:38:57 2018 +0100 patch 8.1.0662: needlessly searching for tilde in string Problem: Needlessly searching for tilde in string. Solution: Only check the first character. (James McCoy, closes https://github.com/vim/vim/issues/3734)
author Bram Moolenaar <Bram@vim.org>
date Sun, 30 Dec 2018 11:45:06 +0100
parents 9df130fd5e0d
children fe428bee74b3
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -4924,7 +4924,7 @@ home_replace(
 	homedir_env = NULL;
 
 #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL)
-    if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL)
+    if (homedir_env != NULL && *homedir_env == '~')
     {
 	int	usedlen = 0;
 	int	flen;