From 2d58f8fdefa2a7326c3dde7f0500f805a534ef1b Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 18 Nov 2023 11:19:57 +0000 Subject: [PATCH] [-] Remove #if 0s from AuRandomDevice (finished working on the rng upgrades) --- Source/RNG/AuRandomDevice.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Source/RNG/AuRandomDevice.cpp b/Source/RNG/AuRandomDevice.cpp index 53ec4909..23eeec39 100644 --- a/Source/RNG/AuRandomDevice.cpp +++ b/Source/RNG/AuRandomDevice.cpp @@ -178,10 +178,6 @@ namespace Aurora::RNG AuInt32 RandomDevice::NextInt(AuInt32 uMin, AuInt32 uMax) { - #if 0 - auto range = uMax - uMin; - return (NextU64() % range) + uMin; - #else auto uRange = uMax - uMin; auto uMassiveWord = NextU32(); auto uUpperBound = RngConvertBounds(uRange + 1); @@ -191,15 +187,10 @@ namespace Aurora::RNG uMassiveWord = AuFnv1a32Runtime(&uMassiveWord, sizeof(uMassiveWord)); } return uMin + uNext; - #endif } AuUInt32 RandomDevice::NextU32(AuUInt32 uMin, AuUInt32 uMax) { - #if 0 - auto range = uMax - uMin; - return (NextU64() % range) + uMin; - #else auto uRange = uMax - uMin; auto uMassiveWord = NextU32(); auto uUpperBound = RngConvertBounds(uRange + 1); @@ -209,7 +200,6 @@ namespace Aurora::RNG uMassiveWord = AuFnv1a32Runtime(&uMassiveWord, sizeof(uMassiveWord)); } return uMin + uNext; - #endif } double RandomDevice::NextDecimal() @@ -219,9 +209,6 @@ namespace Aurora::RNG AuUInt32 RandomDevice::NextIndex(AuUInt32 uCount /* = max + 1*/) { - #if 0 - return NextU32() % uCount; - #else auto uMassiveWord = NextU32(); auto uUpperBound = RngConvertBounds(uCount); AuUInt32 uNext {}; @@ -230,7 +217,6 @@ namespace Aurora::RNG uMassiveWord = AuFnv1a32Runtime(&uMassiveWord, sizeof(uMassiveWord)); } return uNext; - #endif } float RandomDevice::NextNumber(float fMin, float fMax)