From 0add712863269206c1d2cbdc35284671df31faea Mon Sep 17 00:00:00 2001 From: scepheo Date: Thu, 15 May 2014 15:12:30 +0000 Subject: [PATCH] Removed one-use MaxHexValueFromMaxDigits function from StringHelpers.cs. --- .../helpers/StringHelpers.cs | 27 ------------------- .../CustomControls/HexTextBox.cs | 4 +-- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/BizHawk.Client.Common/helpers/StringHelpers.cs b/BizHawk.Client.Common/helpers/StringHelpers.cs index c3de8909dc..cb2aacc305 100644 --- a/BizHawk.Client.Common/helpers/StringHelpers.cs +++ b/BizHawk.Client.Common/helpers/StringHelpers.cs @@ -47,32 +47,5 @@ namespace BizHawk.Client.Common return 8; } - - public static uint MaxHexValueFromMaxDigits(int i) - { - switch (i) - { - case 0: - return 0; - case 1: - return 0xF; - case 2: - return 0xFF; - case 3: - return 0xFFF; - case 4: - return 0xFFFF; - case 5: - return 0xFFFFF; - case 6: - return 0xFFFFFF; - case 7: - return 0xFFFFFFF; - case 8: - return 0xFFFFFFFF; - } - - return int.MaxValue; - } } } diff --git a/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs b/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs index f55fd4aa6a..39c3b067b8 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs @@ -42,8 +42,8 @@ namespace BizHawk.Client.EmuHawk { return (uint)_maxSize.Value; } - - return IntHelpers.MaxHexValueFromMaxDigits(MaxLength); + + return (uint)(((long)1 << (4 * MaxLength)) - 1); } public override void ResetText()