]> git.ipfire.org Git - people/ms/u-boot.git/commit - lib/string.c
string: Use memcpy() within memmove() when we can
authorSimon Glass <sjg@chromium.org>
Wed, 5 Apr 2017 22:23:31 +0000 (16:23 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 10 May 2017 00:19:04 +0000 (20:19 -0400)
commitcb0eae8cf8aaca76910dee4c7eb536d0814d1bd2
tree8e4bb6377bcafcd626ed0bcbcdf960fad5cd1ceb
parent20b429b013c97cb3d253274003d52bbe8c9c4da1
string: Use memcpy() within memmove() when we can

A common use of memmove() can be handled by memcpy(). Also memcpy()
includes an optimisation for large sizes: it copies a word at a time. So
we can get a speed-up by calling memcpy() to handle our move in this case.

Update memmove() to call memcpy() if the destination is before the source.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
lib/string.c