From e206dc1cf625f28149c19eb4dfcbf495ef0efbb4 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 18 Feb 2022 19:31:03 +0100 Subject: refactor: improve options of all kinds --- src/random_generator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/random_generator.cpp') diff --git a/src/random_generator.cpp b/src/random_generator.cpp index 1f17a88..3fdc2d4 100644 --- a/src/random_generator.cpp +++ b/src/random_generator.cpp @@ -1,6 +1,6 @@ #include "random_generator.hpp" -RandomNumberGenerator::RandomNumberGenerator(unsigned int seed) +RandomNumberGenerator::RandomNumberGenerator(const unsigned int &seed) { this->_generator = std::make_unique(seed); } @@ -12,7 +12,8 @@ RandomNumberGenerator::RandomNumberGenerator() this->_generator = std::make_unique(random_device()); } -unsigned int RandomNumberGenerator::in_range(unsigned int a, unsigned int b) +unsigned int RandomNumberGenerator::in_range(const unsigned int &a, + const unsigned int &b) const { auto random_distribution = std::uniform_int_distribution(a, b); -- cgit v1.2.3-18-g5258