Optimize function xcrush_copy_bytes()
authorRaul Fernandes <rgfernandes@gmail.com>
Thu, 24 Oct 2019 16:35:24 +0000 (13:35 -0300)
committerakallabeth <akallabeth@posteo.net>
Tue, 5 May 2020 05:46:09 +0000 (07:46 +0200)
commit54c902b3b520d03c7f4c5bab24713eb42e78ca34
tree4a0ba7beb95f71fab9f3a769c5e125d3df44faa8
parent2ed941f9e2274fecf7e979c2bc8e395c32c481e2
Optimize function xcrush_copy_bytes()

Use memcpy to copy the bytes when we can assure that the memory areas does not overlap.
When the areas overlap, copy the area that doesn't overlap repeatly.
With this change, the copy is ~30x faster.
libfreerdp/codec/xcrush.c