提交 cf289cef 编写于 作者: L Lukas Wunner 提交者: Matt Fleming

lib/ucs2_string: Speed up ucs2_utf8size()

No need to calculate the string length on every loop iteration.
Signed-off-by: NLukas Wunner <lukas@wunner.de>
Cc: Peter Jones <pjones@redhat.com>
Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
上级 d520dd1f
......@@ -56,7 +56,7 @@ ucs2_utf8size(const ucs2_char_t *src)
unsigned long i;
unsigned long j = 0;
for (i = 0; i < ucs2_strlen(src); i++) {
for (i = 0; src[i]; i++) {
u16 c = src[i];
if (c >= 0x800)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册