perf: reuse fast character size calculation algorithm from getvcol()

This commit is contained in:
VanaIgr
2023-12-18 20:57:04 -06:00
committed by zeertzjq
parent b5653984e5
commit cdf848a314
10 changed files with 497 additions and 477 deletions

View File

@@ -110,3 +110,11 @@ static inline StrCharInfo utfc_next(StrCharInfo cur)
next += next_len;
}
}
static inline StrCharInfo utf_ptr2StrCharInfo(char *ptr)
REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE REAL_FATTR_PURE;
static inline StrCharInfo utf_ptr2StrCharInfo(char *ptr)
{
return (StrCharInfo){ .ptr = ptr, .chr = utf_ptr2CharInfo(ptr) };
}