From 65a5088092a6dc28aa12945d7804a34a92227e03 Mon Sep 17 00:00:00 2001 From: Fabrice Ducos Date: Sun, 23 Apr 2023 14:40:20 +0200 Subject: [PATCH] src/core/org/luaj/vm2/compiler/FuncState.java: reverted changed from generic HashMap to non generic Hashtable for JME portability --- src/core/org/luaj/vm2/compiler/FuncState.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/org/luaj/vm2/compiler/FuncState.java b/src/core/org/luaj/vm2/compiler/FuncState.java index 049c60c2..98534d50 100644 --- a/src/core/org/luaj/vm2/compiler/FuncState.java +++ b/src/core/org/luaj/vm2/compiler/FuncState.java @@ -21,8 +21,7 @@ ******************************************************************************/ package org.luaj.vm2.compiler; -import java.util.Map; -import java.util.HashMap; +import java.util.Hashtable; import org.luaj.vm2.LocVars; import org.luaj.vm2.Lua; @@ -48,7 +47,7 @@ public class FuncState extends Constants { }; Prototype f; /* current function header */ - Map h; /* table to find (and reuse) elements in `k' */ + Hashtable h; /* table to find (and reuse) elements in `k' */ FuncState prev; /* enclosing function */ LexState ls; /* lexical state */ BlockCnt bl; /* chain of current blocks */ @@ -475,7 +474,7 @@ public class FuncState extends Constants { } int addk(LuaValue v) { if (this.h == null) { - this.h = new HashMap<>(); + this.h = new Hashtable(); } else if (this.h.containsKey(v)) { return ((Integer) h.get(v)).intValue(); }