From ecdcad25fc222b09d6458d64b0b02f5950c93d64 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Wed, 16 Sep 2015 16:45:51 +0300 Subject: [PATCH] TrimArray() simplification --- Novacoin/Interop.cs | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Novacoin/Interop.cs b/Novacoin/Interop.cs index f3a9e2e..54768cf 100644 --- a/Novacoin/Interop.cs +++ b/Novacoin/Interop.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text; namespace Novacoin @@ -90,10 +91,7 @@ namespace Novacoin trimStart--; } - byte[] result = new byte[trimStart + 1]; - Array.Copy(bytes, 0, result, 0, trimStart + 1); - - return result; + return bytes.Take(trimStart + 1).ToArray(); } public static byte[] AppendWithZeros(byte[] bytes, int nTargetLen=32) -- 1.7.1