mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 17:28:52 -04:00
Remove "n" list field setting, decrease OC-LuaJ size.
Setting "n" inside a numbered list was only fully supported up until Lua 5.0, and was fully removed by Lua 5.2 (which is the lowest version we support). To improve performance and memory usage a little, remove setting it across the OpenComputers Lua world (including in our fork of LuaJ). In addition, more unused LuaJ code was removed, saving about ~100-130KB after JAR compression.
This commit is contained in:
parent
e652fd8df1
commit
fa30722e6b
@ -161,7 +161,7 @@ dependencies {
|
||||
|
||||
compile 'com.google.code.findbugs:jsr305:1.3.9' // Annotations used by google libs.
|
||||
|
||||
embedded name: 'OC-LuaJ', version: '20220904.0', ext: 'jar'
|
||||
embedded name: 'OC-LuaJ', version: '20220907.1', ext: 'jar'
|
||||
embedded name: 'OC-JNLua', version: '20220904.0', ext: 'jar'
|
||||
embedded name: 'OC-JNLua-Natives', version: '20220904.0', ext: 'jar'
|
||||
|
||||
|
@ -81,9 +81,6 @@ object ExtendedLuaState {
|
||||
}
|
||||
// Bring table back to top (in case memo values were pushed).
|
||||
lua.pushValue(tableIndex)
|
||||
lua.pushString("n")
|
||||
lua.pushInteger(count)
|
||||
lua.rawSet(-3)
|
||||
}
|
||||
|
||||
def pushTable(obj: AnyRef, map: Map[_, _], memo: util.IdentityHashMap[Any, Int]) {
|
||||
|
@ -59,9 +59,7 @@ object ScalaClosure {
|
||||
}
|
||||
|
||||
def toLuaList(value: Iterable[Any]): LuaValue = {
|
||||
val table = LuaValue.listOf(value.map(toLuaValue).toArray)
|
||||
table.set("n", table.length())
|
||||
table
|
||||
LuaValue.listOf(value.map(toLuaValue).toArray)
|
||||
}
|
||||
|
||||
def toLuaTable(value: Map[_, _]): LuaValue = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user