From 0a64a66b266d8497b1dcfbc69a0c2700137ae8ff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 22 Jul 2018 17:30:56 -0400 Subject: [PATCH] FPRSqrtEstimate: Deduplicate array bounds Dehardcodes a few constants in the loops. --- src/common/fp/op/FPRSqrtEstimate.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/fp/op/FPRSqrtEstimate.cpp b/src/common/fp/op/FPRSqrtEstimate.cpp index 97f04fdc..3f5c490c 100644 --- a/src/common/fp/op/FPRSqrtEstimate.cpp +++ b/src/common/fp/op/FPRSqrtEstimate.cpp @@ -22,9 +22,11 @@ namespace Dynarmic::FP { /// Input is a u1.8 fixed point number. static u8 RecipSqrtEstimate(u64 a) { - static const std::array lut = []{ - std::array result{}; - for (u64 i = 128; i < 512; i++) { + using LUT = std::array; + + static const LUT lut = [] { + LUT result{}; + for (u64 i = 128; i < result.size(); i++) { u64 a = i; if (a < 256) { a = a * 2 + 1;