Add LTable.put(String,int) utility function
This commit is contained in:
@@ -146,6 +146,14 @@ public class LTable extends LValue {
|
||||
put( new LString( key ), value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method for putting a string key, int value directly, typically for
|
||||
* initializing a table. Bypasses the metatable, if any.
|
||||
*/
|
||||
public void put( String key, int value ) {
|
||||
put( new LString( key ), LInteger.valueOf(value) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for putting an integer-keyed value. Bypasses the metatable, if
|
||||
* any.
|
||||
|
||||
Reference in New Issue
Block a user