summaryrefslogtreecommitdiffstats
path: root/lib/ucs2_string.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2016-08-03 10:16:02 +0200
committerMatt Fleming <matt@codeblueprint.co.uk>2016-09-09 16:08:46 +0100
commitcf289cefbfde519bbc179a86cdc5e8cc91a0a08d (patch)
treeafcdd2877f334ee47aa14f426c64cdd8369a1e3b /lib/ucs2_string.c
parentd520dd1f348dcaafcb8ce804b2a5ebb1be004719 (diff)
downloadlinux-stable-cf289cefbfde519bbc179a86cdc5e8cc91a0a08d.tar.gz
linux-stable-cf289cefbfde519bbc179a86cdc5e8cc91a0a08d.tar.bz2
linux-stable-cf289cefbfde519bbc179a86cdc5e8cc91a0a08d.zip
lib/ucs2_string: Speed up ucs2_utf8size()
No need to calculate the string length on every loop iteration. Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: Peter Jones <pjones@redhat.com> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Diffstat (limited to 'lib/ucs2_string.c')
-rw-r--r--lib/ucs2_string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ucs2_string.c b/lib/ucs2_string.c
index f0b323abb4c6..ae8d2491133c 100644
--- a/lib/ucs2_string.c
+++ b/lib/ucs2_string.c
@@ -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)