-Removed unused utility methods

-Fixed various code warnings
This commit is contained in:
JamesNK
2012-01-17 11:22:16 +00:00
parent 2941344044
commit 61db48c01d
29 changed files with 59 additions and 1131 deletions
@@ -42,23 +42,6 @@ namespace Newtonsoft.Json.Utilities
return (int)Math.Floor(Math.Log10(i)) + 1;
}
public static int HexToInt(char h)
{
if ((h >= '0') && (h <= '9'))
{
return (h - '0');
}
if ((h >= 'a') && (h <= 'f'))
{
return ((h - 'a') + 10);
}
if ((h >= 'A') && (h <= 'F'))
{
return ((h - 'A') + 10);
}
return -1;
}
public static char IntToHex(int n)
{
if (n <= 9)
@@ -68,23 +51,6 @@ namespace Newtonsoft.Json.Utilities
return (char)((n - 10) + 97);
}
public static int GetDecimalPlaces(double value)
{
// increasing max decimal places above 10 produces weirdness
int maxDecimalPlaces = 10;
double threshold = Math.Pow(0.1d, maxDecimalPlaces);
if (value == 0.0)
return 0;
int decimalPlaces = 0;
while (value - Math.Floor(value) > threshold && decimalPlaces < maxDecimalPlaces)
{
value *= 10.0;
decimalPlaces++;
}
return decimalPlaces;
}
public static int? Min(int? val1, int? val2)
{
if (val1 == null)
@@ -105,16 +71,6 @@ namespace Newtonsoft.Json.Utilities
return Math.Max(val1.Value, val2.Value);
}
public static double? Min(double? val1, double? val2)
{
if (val1 == null)
return val2;
if (val2 == null)
return val1;
return Math.Min(val1.Value, val2.Value);
}
public static double? Max(double? val1, double? val2)
{
if (val1 == null)