Just add some syntactic sugar
authorCryptoManiac <balthazar@yandex.ru>
Mon, 24 Aug 2015 00:33:41 +0000 (03:33 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Mon, 24 Aug 2015 00:33:41 +0000 (03:33 +0300)
Novacoin/ByteQueue.cs
Novacoin/CScript.cs
Novacoin/ScriptCode.cs

index 5fd6923..a1ba14c 100644 (file)
@@ -77,7 +77,7 @@ namespace Novacoin
                 throw new ByteQueueException("Unable to read requested amount of data.");
             }
 
-            byte[] result = Elements.GetRange(Index, Count).ToArray();
+            var result = Elements.GetRange(Index, Count).ToArray();
             Index += Count;
 
             return result;
@@ -90,7 +90,7 @@ namespace Novacoin
                 throw new ByteQueueException("Unable to read requested amount of data.");
             }
 
-            byte[] result = Elements.GetRange(Index, Count).ToArray();
+            var result = Elements.GetRange(Index, Count).ToArray();
 
             return result;
         }
index 1bd4ede..bbb2a61 100644 (file)
@@ -135,7 +135,7 @@ namespace Novacoin
                 // OP_PUSHDATA1 0x00 0x01 [0x5a]
                 codeBytes.Add((byte)instruction.OP_PUSHDATA2);
 
-                byte[] szBytes = Interop.BEBytes((ushort)nCount);
+                var szBytes = Interop.BEBytes((ushort)nCount);
                 codeBytes.AddRange(szBytes);
             }
             else if (nCount < 0xffffffff)
@@ -143,7 +143,7 @@ namespace Novacoin
                 // OP_PUSHDATA1 0x00 0x00 0x00 0x01 [0x5a]
                 codeBytes.Add((byte)instruction.OP_PUSHDATA4);
 
-                byte[] szBytes = Interop.BEBytes((uint)nCount);
+                var szBytes = Interop.BEBytes((uint)nCount);
                 codeBytes.AddRange(szBytes);
             }
 
index 4f86d73..8764b71 100644 (file)
@@ -267,7 +267,7 @@ namespace Novacoin
             // Immediate operand
             if (opcode <= instruction.OP_PUSHDATA4)
             {
-                byte[] szBytes = new byte[4] { 0, 0, 0, 0 }; // Zero length
+                var szBytes = new byte[4] { 0, 0, 0, 0 }; // Zero length
 
                 try
                 {
@@ -1568,11 +1568,11 @@ namespace Novacoin
                                         return false;
                                     }
 
-                                    byte[] sigBytes = stacktop(ref stack, -2);
-                                    byte[] pubkeyBytes = stacktop(ref stack, -1);
+                                    var sigBytes = stacktop(ref stack, -2);
+                                    var pubkeyBytes = stacktop(ref stack, -1);
 
                                     // Subset of script starting at the most recent codeseparator
-                                    CScript scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin));
+                                    var scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin));
 
                                     // There's no way for a signature to sign itself
                                     scriptCode.RemovePattern(sigBytes);
@@ -1639,7 +1639,7 @@ namespace Novacoin
                                     }
 
                                     // Subset of script starting at the most recent codeseparator
-                                    CScript scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin));
+                                    var scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin));
 
                                     // There is no way for a signature to sign itself, so we need to drop the signatures
                                     for (int k = 0; k < nSigsCount; k++)