Skip to content

Commit 7c0243e

Browse files
committed
Don't allocate arrays for every table
Wow, this was incredibly dumb
1 parent 9c32acd commit 7c0243e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/squiddev/cobalt/LuaTable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
* @see LuaValue
8181
*/
8282
public final class LuaTable extends LuaValue {
83-
private Object[] EMPTY_ARRAY = new Object[0];
84-
private Node[] EMPTY_NODES = new Node[0];
83+
private static final Object[] EMPTY_ARRAY = new Object[0];
84+
private static final Node[] EMPTY_NODES = new Node[0];
8585
private static final LuaString N = valueOf("n");
8686

8787
private Object[] array = EMPTY_ARRAY;

0 commit comments

Comments
 (0)