vim-patch:8.1.2120: some MB_ macros are more complicated than necessary

Problem:    Some MB_ macros are more complicated than necessary. (Dominique
            Pelle)
Solution:   Simplify the macros.  Expand inline.
1614a14901
This commit is contained in:
Jan Edmund Lazo
2019-10-06 20:52:30 -04:00
parent 8f20c50caa
commit 09232958ff
12 changed files with 53 additions and 53 deletions

View File

@@ -1833,13 +1833,13 @@ static int vgetorpeek(int advance)
char_u *p1 = mp->m_keys;
char_u *p2 = (char_u *)mb_unescape((const char **)&p1);
if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
if (p2 != NULL && MB_BYTE2LEN(c1) > utfc_ptr2len(p2)) {
mlen = 0;
/*
* Check an entry whether it matches.
* - Full match: mlen == keylen
* - Partly match: mlen == typebuf.tb_len
*/
}
// Check an entry whether it matches.
// - Full match: mlen == keylen
// - Partly match: mlen == typebuf.tb_len
keylen = mp->m_keylen;
if (mlen == keylen
|| (mlen == typebuf.tb_len