From afc3531945332af5452c8cf4ccf4c9c014ddf741 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 23 Sep 2021 14:08:43 +0300 Subject: [PATCH] ci: work around a failing g++ compilation (order of methods in an interface dispatching table matters for C++ compilers) --- vlib/rand/wyrand/wyrand.v | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vlib/rand/wyrand/wyrand.v b/vlib/rand/wyrand/wyrand.v index 23cf2a8ec7..a55a243ce1 100644 --- a/vlib/rand/wyrand/wyrand.v +++ b/vlib/rand/wyrand/wyrand.v @@ -22,12 +22,6 @@ mut: extra u32 } -// free should be called when the generator is no longer needed -[unsafe] -pub fn (mut rng WyRandRNG) free() { - unsafe { free(rng) } -} - // seed sets the seed, needs only two `u32`s in little-endian format as [lower, higher]. pub fn (mut rng WyRandRNG) seed(seed_data []u32) { if seed_data.len != 2 { @@ -256,3 +250,9 @@ pub fn (mut rng WyRandRNG) f64_in_range(min f64, max f64) f64 { } return min + rng.f64n(max - min) } + +// free should be called when the generator is no longer needed +[unsafe] +pub fn (mut rng WyRandRNG) free() { + unsafe { free(rng) } +}