mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js: fix rand
build, properly use key values on map, add rand.string
(#12020)
This commit is contained in:
@ -38,19 +38,6 @@ __global (
|
||||
default_rng &PRNG
|
||||
)
|
||||
|
||||
// init initializes the default RNG.
|
||||
fn init() {
|
||||
default_rng = new_default()
|
||||
C.atexit(deinit)
|
||||
}
|
||||
|
||||
fn deinit() {
|
||||
unsafe {
|
||||
default_rng.free() // free the implementation
|
||||
free(default_rng) // free the interface wrapper itself
|
||||
}
|
||||
}
|
||||
|
||||
// new_default returns a new instance of the default RNG. If the seed is not provided, the current time will be used to seed the instance.
|
||||
[manualfree]
|
||||
pub fn new_default(config config.PRNGConfigStruct) &PRNG {
|
||||
|
Reference in New Issue
Block a user