3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

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 ...]
List<ScriptChunk> chunks;
byte[] programCopy; // TODO: remove this
private final NetworkParameters params;
/**
@ -167,10 +166,9 @@ public class Script {
*/
private void parse(byte[] programBytes, int offset, int length) throws ScriptException {
// TODO: this is inefficient
programCopy = new byte[length];
System.arraycopy(programBytes, offset, programCopy, 0, length);
program = new byte[length];
System.arraycopy(programBytes, offset, program, 0, length);
program = programCopy;
offset = 0;
chunks = new ArrayList<ScriptChunk>(10); // Arbitrary choice of initial size.
cursor = offset;