From 53fa0d1ca0bce4002965036fc87abb2a6885b2cc Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Wed, 23 Apr 2008 17:34:04 +0000 Subject: [PATCH] Remove name passing into UpVal instances. --- src/core/org/luaj/vm/LuaState.java | 6 +++--- src/core/org/luaj/vm/UpVal.java | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/core/org/luaj/vm/LuaState.java b/src/core/org/luaj/vm/LuaState.java index dd8c747c..bbbb73c7 100644 --- a/src/core/org/luaj/vm/LuaState.java +++ b/src/core/org/luaj/vm/LuaState.java @@ -848,7 +848,7 @@ public class LuaState extends Lua { if (o == LuaState.OP_GETUPVAL) { newClosure.upVals[j] = cl.upVals[b]; } else if (o == LuaState.OP_MOVE) { - newClosure.upVals[j] = findUpVal( proto.upvalues[j], base + b ); + newClosure.upVals[j] = findUpVal( base + b ); } else { throw new java.lang.IllegalArgumentException( "bad opcode: " + o); @@ -879,7 +879,7 @@ public class LuaState extends Lua { } } - private UpVal findUpVal( LString upValName, int target ) { + private UpVal findUpVal( int target ) { UpVal up; int i; for ( i = this.upvals.size() - 1; i >= 0; --i ) { @@ -891,7 +891,7 @@ public class LuaState extends Lua { } } - up = new UpVal( upValName, this, target ); + up = new UpVal( this, target ); this.upvals.insertElementAt( up, i + 1 ); return up; } diff --git a/src/core/org/luaj/vm/UpVal.java b/src/core/org/luaj/vm/UpVal.java index cb15a315..014c26af 100644 --- a/src/core/org/luaj/vm/UpVal.java +++ b/src/core/org/luaj/vm/UpVal.java @@ -24,19 +24,17 @@ package org.luaj.vm; public class UpVal { - private LString name; LuaState state; int position; LValue value; - public UpVal( LString string, LuaState state, int i ) { - this.name = string; + public UpVal( LuaState state, int i ) { this.state = state; this.position = i; } public String toString() { - return "up."+name; + return "up."+position; } public LValue getValue() {