Merge pull request #21 from lorenzos/patch-1
Check the type before reusing a NumberValueEntry
This commit was merged in pull request #21.
This commit is contained in:
@@ -1246,14 +1246,15 @@ public class LuaTable extends LuaValue implements Metatable {
|
||||
}
|
||||
|
||||
public Entry set(LuaValue value) {
|
||||
if (value.type() == TNUMBER) {
|
||||
LuaValue n = value.tonumber();
|
||||
if (!n.isnil()) {
|
||||
this.value = n.todouble();
|
||||
return this;
|
||||
} else {
|
||||
return new NormalEntry( this.key, value );
|
||||
}
|
||||
}
|
||||
return new NormalEntry( this.key, value );
|
||||
}
|
||||
|
||||
public int keyindex( int mask ) {
|
||||
return hashSlot( key, mask );
|
||||
|
||||
Reference in New Issue
Block a user