]> granicus.if.org Git - musl/commitdiff
optimize mempcpy to minimize need for data saved across the call
authorRich Felker <dalias@aerifal.cx>
Wed, 1 Aug 2012 01:18:17 +0000 (21:18 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 1 Aug 2012 01:18:17 +0000 (21:18 -0400)
src/string/mempcpy.c

index 1b323f1eef21e48981387f3656384ff0fa94aa0e..c23ca69eddddd400e4cb8deb29022bf7d2d2d175 100644 (file)
@@ -2,6 +2,5 @@
 
 void *mempcpy(void *dest, const void *src, size_t n)
 {
-       memcpy(dest, src, n);
-       return (char *)dest + n;
+       return (char *)memcpy(dest, src, n) + n;
 }