# std.rand: Refactor \`Random\` interface · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c1a5ff34f3f68a2a0bc32828ab483328cd436fea)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c1a5ff34f3f68a2a0bc32828ab483328cd436fea

Requested commit: c1a5ff34f3f68a2a0bc32828ab483328cd436fea

Commit: c1a5ff34f3f68a2a0bc32828ab483328cd436fea

Tree: bad85387a89da38890f72696ccfc0ae3c416ab0f

Author: Ominitay

Committer: Andrew Kelley

## Message

```
std.rand: Refactor `Random` interface

These changes have been made to resolve issue #10037. The `Random`
interface was implemented in such a way that causes significant slowdown
when calling the `fill` function of the rng used.

The `Random` interface is no longer stored in a field of the rng, and is
instead returned by the child function `random()` of the rng. This
avoids the performance issues caused by the interface.

```

## Parents

- [9024f27d8f5cb651e2260348ce0ee6fd67fc2c32](https://git.cafe/gitcafe/zig/commit/9024f27d8f5cb651e2260348ce0ee6fd67fc2c32?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c1a5ff34f3f68a2a0bc32828ab483328cd436fea?format=markdown)
