Remove redundant programCopy from Script.

This commit is contained in:
Matt Corallo 2012-07-26 13:14:56 +02:00 committed by Mike Hearn
parent dc943b6e6d
commit 5abc124134

View file

@ -71,7 +71,6 @@ public class Script {
// The program is a set of byte[]s where each element is either [opcode] or [data, data, data ...] // The program is a set of byte[]s where each element is either [opcode] or [data, data, data ...]
List<ScriptChunk> chunks; List<ScriptChunk> chunks;
byte[] programCopy; // TODO: remove this
private final NetworkParameters params; private final NetworkParameters params;
/** /**
@ -167,10 +166,9 @@ public class Script {
*/ */
private void parse(byte[] programBytes, int offset, int length) throws ScriptException { private void parse(byte[] programBytes, int offset, int length) throws ScriptException {
// TODO: this is inefficient // TODO: this is inefficient
programCopy = new byte[length]; program = new byte[length];
System.arraycopy(programBytes, offset, programCopy, 0, length); System.arraycopy(programBytes, offset, program, 0, length);
program = programCopy;
offset = 0; offset = 0;
chunks = new ArrayList<ScriptChunk>(10); // Arbitrary choice of initial size. chunks = new ArrayList<ScriptChunk>(10); // Arbitrary choice of initial size.
cursor = offset; cursor = offset;