* [PATCH] lib/ucs2_string: Speed up ucs2_utf8size()
@ 2016-08-03 8:16 Lukas Wunner
[not found] ` <c45b75bbb1bd486429ab993d66167f22f14cf415.1470211796.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wunner @ 2016-08-03 8:16 UTC (permalink / raw)
To: linux-efi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming; +Cc: Peter Jones
No need to calculate the string length on every loop iteration.
Cc: Peter Jones <pjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
---
lib/ucs2_string.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ucs2_string.c b/lib/ucs2_string.c
index f0b323a..ae8d249 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)
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lib/ucs2_string: Speed up ucs2_utf8size()
[not found] ` <c45b75bbb1bd486429ab993d66167f22f14cf415.1470211796.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
@ 2016-08-09 10:51 ` Matt Fleming
0 siblings, 0 replies; 2+ messages in thread
From: Matt Fleming @ 2016-08-09 10:51 UTC (permalink / raw)
To: Lukas Wunner; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA, Peter Jones
On Wed, 03 Aug, at 10:16:02AM, Lukas Wunner wrote:
> No need to calculate the string length on every loop iteration.
>
> Cc: Peter Jones <pjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
> ---
> lib/ucs2_string.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-09 10:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03 8:16 [PATCH] lib/ucs2_string: Speed up ucs2_utf8size() Lukas Wunner
[not found] ` <c45b75bbb1bd486429ab993d66167f22f14cf415.1470211796.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-08-09 10:51 ` Matt Fleming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).