diff options
author | mskorokhod <mskorokhod@yandex-team.ru> | 2022-02-10 16:52:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:52:10 +0300 |
commit | dc5972f19ddb40b225e93b0fec8e3f8b858c1913 (patch) | |
tree | ab7fbbf3253d4c0e2793218f09378908beb025fb /util/random | |
parent | e7adae184c30da49fd2aeb27144845235abc52d0 (diff) | |
download | ydb-dc5972f19ddb40b225e93b0fec8e3f8b858c1913.tar.gz |
Restoring authorship annotation for <mskorokhod@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/random')
-rw-r--r-- | util/random/random.cpp | 20 | ||||
-rw-r--r-- | util/random/random.h | 10 | ||||
-rw-r--r-- | util/random/random_ut.cpp | 14 |
3 files changed, 22 insertions, 22 deletions
diff --git a/util/random/random.cpp b/util/random/random.cpp index 34e7037d31..71f9323856 100644 --- a/util/random/random.cpp +++ b/util/random/random.cpp @@ -40,11 +40,11 @@ namespace { : TMersenne<T>(TProcStream().S()) { } - - inline TRndGen(T seed) - : TMersenne<T>(seed) - { - } + + inline TRndGen(T seed) + : TMersenne<T>(seed) + { + } }; template <class T> @@ -118,8 +118,8 @@ void ResetRandomState() { *GetRndGen<ui32>() = TRndGen<ui32>(); *GetRndGen<ui64>() = TRndGen<ui64>(); } - -void SetRandomSeed(int seed) { - *GetRndGen<ui32>() = TRndGen<ui32>(seed); - *GetRndGen<ui64>() = TRndGen<ui64>(seed); -} + +void SetRandomSeed(int seed) { + *GetRndGen<ui32>() = TRndGen<ui32>(seed); + *GetRndGen<ui64>() = TRndGen<ui64>(seed); +} diff --git a/util/random/random.h b/util/random/random.h index abdd190d68..16b52d3995 100644 --- a/util/random/random.h +++ b/util/random/random.h @@ -23,8 +23,8 @@ T RandomNumber(T max); * Re-initialize random state - useful after forking in multi-process programs. */ void ResetRandomState(); - -/* - * Set random SEED - */ -void SetRandomSeed(int seed); + +/* + * Set random SEED + */ +void SetRandomSeed(int seed); diff --git a/util/random/random_ut.cpp b/util/random/random_ut.cpp index 5543daa06a..30427676f3 100644 --- a/util/random/random_ut.cpp +++ b/util/random/random_ut.cpp @@ -80,10 +80,10 @@ Y_UNIT_TEST_SUITE(TRandomNumberTest) { while (!RandomNumber<bool>()) { } } - - Y_UNIT_TEST(TestResetSeed) { - SetRandomSeed(42); - for (const ui32 el : { + + Y_UNIT_TEST(TestResetSeed) { + SetRandomSeed(42); + for (const ui32 el : { 102, 179, 92, @@ -149,7 +149,7 @@ Y_UNIT_TEST_SUITE(TRandomNumberTest) { 20, 72, }) { - UNIT_ASSERT_EQUAL(RandomNumber<ui32>(1 << 8), el); - } - } + UNIT_ASSERT_EQUAL(RandomNumber<ui32>(1 << 8), el); + } + } } |