about summary refs log tree commit diff
path: root/src/string
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-09-23 02:51:01 -0400
committerRich Felker <dalias@aerifal.cx>2018-09-23 02:51:01 -0400
commit8cd738bbee3b4e60a99b71599c338bf444070f18 (patch)
tree6823ca228fe53416f45fdd281c8f67e8072c1926 /src/string
parent82c41e92320c3f84bd6d24e21c5350a06e2fc831 (diff)
downloadmusl-8cd738bbee3b4e60a99b71599c338bf444070f18.tar.gz
musl-8cd738bbee3b4e60a99b71599c338bf444070f18.tar.xz
musl-8cd738bbee3b4e60a99b71599c338bf444070f18.zip
optimize nop case of wmemmove
Diffstat (limited to 'src/string')
-rw-r--r--src/string/wmemmove.c1
1 files changed, 1 insertions, 0 deletions
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