projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d520dd1
)
lib/ucs2_string: Speed up ucs2_utf8size()
author
Lukas Wunner
<lukas@wunner.de>
Wed, 3 Aug 2016 08:16:02 +0000
(10:16 +0200)
committer
Matt Fleming
<matt@codeblueprint.co.uk>
Fri, 9 Sep 2016 15:08:46 +0000
(16:08 +0100)
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>
lib/ucs2_string.c
patch
|
blob
|
history
diff --git
a/lib/ucs2_string.c
b/lib/ucs2_string.c
index
f0b323a
..
ae8d249
100644
(file)
--- 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)