From 3a7537afd10c5952ee8dae89d10018e383a10edd Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 5 Nov 2015 21:25:27 +0400 Subject: [PATCH] (CgFormat.Reader): use Binary.CopyOverlapped where applicable. --- ArcFormats/AnimeGameSystem/ImageAinos.cs | 30 ++++-------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/ArcFormats/AnimeGameSystem/ImageAinos.cs b/ArcFormats/AnimeGameSystem/ImageAinos.cs index e8ac08c2..9698c0b5 100644 --- a/ArcFormats/AnimeGameSystem/ImageAinos.cs +++ b/ArcFormats/AnimeGameSystem/ImageAinos.cs @@ -241,20 +241,9 @@ namespace GameRes.Formats.Ainos if (0 != shift) { int src = dst + ShiftTable[shift]; - while (0 != count) - { - m_output[dst] = m_output[src]; - m_output[dst + 1] = m_output[src+1]; - m_output[dst + 2] = m_output[src+2]; - src += 3; - dst += 3; - --count; - } - } - else - { - dst += 3 * count; + Binary.CopyOverlapped (m_output, src, dst, count * 3); } + dst += 3 * count; } left += m_width*3; //640*3; right += m_width*3; //640*3; @@ -301,20 +290,9 @@ namespace GameRes.Formats.Ainos if (0 != shift) { int src = dst + ShiftTable[shift]; - while (0 != count) - { - m_output[dst] = m_output[src]; - m_output[dst + 1] = m_output[src + 1]; - m_output[dst + 2] = m_output[src + 2]; - src += 3; - dst += 3; - --count; - } - } - else - { - dst += 3 * count; + Binary.CopyOverlapped (m_output, src, dst, count * 3); } + dst += 3 * count; } right += m_width*3; left += m_width*3;