mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-11 12:39:16 +08:00
(CopyOverlapped): slightly optimized BlockCopy loop.
This commit is contained in:
parent
f87944b7e1
commit
aeea84a693
@ -73,15 +73,12 @@ namespace GameRes.Utility
|
||||
|
||||
public static void CopyOverlapped (byte[] data, int src, int dst, int count)
|
||||
{
|
||||
int preceding = dst-src;
|
||||
if (preceding > 0)
|
||||
if (dst > src)
|
||||
{
|
||||
while (count > 0)
|
||||
{
|
||||
if (preceding > count)
|
||||
preceding = count;
|
||||
int preceding = System.Math.Min (dst - src, count);
|
||||
System.Buffer.BlockCopy (data, src, data, dst, preceding);
|
||||
src = dst;
|
||||
dst += preceding;
|
||||
count -= preceding;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user