diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-02-09 13:42:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-09 13:42:04 -0800 |
| commit | 32f30399e5cd42af2d670321979aa424803b1819 (patch) | |
| tree | 97963ae96b09538a4dc21dd964b955c807666842 /src | |
| parent | 54bbc73f8502fe073d385361ddb34a43d12eec39 (diff) | |
| parent | 60639ec83d0ccb7a26a19ae64452b00141d48354 (diff) | |
| download | zig-32f30399e5cd42af2d670321979aa424803b1819.tar.gz zig-32f30399e5cd42af2d670321979aa424803b1819.zip | |
Merge pull request #18867 from e4m2/random
std.rand: Move to std.Random
Diffstat (limited to 'src')
| -rw-r--r-- | src/reduce.zig | 4 | ||||
| -rw-r--r-- | src/resinator/compile.zig | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/reduce.zig b/src/reduce.zig index a0b1bc8a18..027557bea5 100644 --- a/src/reduce.zig +++ b/src/reduce.zig @@ -136,7 +136,7 @@ pub fn main(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { var more_fixups: Ast.Fixups = .{}; defer more_fixups.deinit(gpa); - var rng = std.rand.DefaultPrng.init(seed); + var rng = std.Random.DefaultPrng.init(seed); // 1. Walk the AST of the source file looking for independent // reductions and collecting them all into an array list. @@ -274,7 +274,7 @@ pub fn main(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { return std.process.cleanExit(); } -fn sortTransformations(transformations: []Walk.Transformation, rng: std.rand.Random) void { +fn sortTransformations(transformations: []Walk.Transformation, rng: std.Random) void { rng.shuffle(Walk.Transformation, transformations); // Stable sort based on priority to keep randomness as the secondary sort. // TODO: introduce transformation priorities diff --git a/src/resinator/compile.zig b/src/resinator/compile.zig index 4de218da4f..0c71b02027 100644 --- a/src/resinator/compile.zig +++ b/src/resinator/compile.zig @@ -3356,7 +3356,7 @@ test "StringTable" { } break :ids buf; }; - var prng = std.rand.DefaultPrng.init(0); + var prng = std.Random.DefaultPrng.init(0); var random = prng.random(); random.shuffle(u16, &ids); |
