aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-03 14:00:45 +0800
committerGitHub <noreply@github.com>2023-09-03 14:00:45 +0800
commit820522d685e2794c638144a88ceee50d53bdc104 (patch)
treece99a3c8a43c18d62bbee56d861505972acb6096
parentbebdf1dab345471222f6755c574d04596fea92fd (diff)
downloadrneovim-820522d685e2794c638144a88ceee50d53bdc104.tar.gz
rneovim-820522d685e2794c638144a88ceee50d53bdc104.tar.bz2
rneovim-820522d685e2794c638144a88ceee50d53bdc104.zip
refactor(ex_session.c): remove unnecessary char -> int -> char cast
The two calls to get_view_file() both pass a char in a string, and get_view_file() assigns it to a char in a string.
-rw-r--r--src/nvim/ex_session.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index d47d40cbee..e2a4f73840 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -1080,7 +1080,7 @@ void ex_mkrc(exarg_T *eap)
}
/// @return the name of the view file for the current buffer.
-static char *get_view_file(int c)
+static char *get_view_file(char c)
{
if (curbuf->b_ffname == NULL) {
emsg(_(e_noname));
@@ -1119,8 +1119,7 @@ static char *get_view_file(int c)
}
}
*s++ = '=';
- assert(c >= CHAR_MIN && c <= CHAR_MAX);
- *s++ = (char)c;
+ *s++ = c;
xstrlcpy(s, ".vim", 5);
xfree(sname);