From 5cecd7a93aba83cd477519974fc33fadbdcfdc87 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Sun, 1 Jul 2018 22:58:42 +0300 Subject: style: fixing minor issues noted in code review. --- src/nvim/ex_docmd.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 0ff0b1b574..3d3d02fd71 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -2899,11 +2899,7 @@ const char * set_one_cmd_context( xp->xp_pattern = skipwhite((const char_u *)arg); p = (const char *)xp->xp_pattern; while (*p != NUL) { - if (has_mbyte) { - c = utf_ptr2char((const char_u *)p); - } else { - c = (uint8_t)(*p); - } + c = utf_ptr2char((const char_u *)p); if (c == '\\' && p[1] != NUL) { p++; } else if (c == '`') { @@ -2921,19 +2917,11 @@ const char * set_one_cmd_context( || ascii_iswhite(c)) { len = 0; /* avoid getting stuck when space is in 'isfname' */ while (*p != NUL) { - if (has_mbyte) { - c = utf_ptr2char((const char_u *)p); - } else { - c = *p; - } + c = utf_ptr2char((const char_u *)p); if (c == '`' || vim_isfilec_or_wc(c)) { break; } - if (has_mbyte) { - len = (size_t)(*mb_ptr2len)((const char_u *)p); - } else { - len = 1; - } + len = (size_t)utfc_ptr2len((const char_u *)p); MB_PTR_ADV(p); } if (in_quote) { -- cgit