From 8cd738bbee3b4e60a99b71599c338bf444070f18 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 23 Sep 2018 02:51:01 -0400 Subject: [PATCH] optimize nop case of wmemmove --- src/string/wmemmove.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/string/wmemmove.c b/src/string/wmemmove.c index d58cebac..964c9032 100644 --- a/src/string/wmemmove.c +++ b/src/string/wmemmove.c @@ -4,6 +4,7 @@ wchar_t *wmemmove(wchar_t *d, const wchar_t *s, size_t n) { wchar_t *d0 = d; + if (d == s) return d; if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d) while (n--) d[n] = s[n]; else -- 2.25.1