lib/ucs2_string: Speed up ucs2_utf8size()

No need to calculate the string length on every loop iteration.

Signed-off-by: Lukas Wunner <[email protected]>
Cc: Peter Jones <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
This commit is contained in:
Lukas Wunner authored and Matt Fleming committed 2016-09-09 16:08:46 +01:00
1 parent d520dd1f34
commit cf289cefbf
1 file changed
+1 -1
+1 -1
View File
@@ -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)