Skip to content

Commit

Permalink
Delete contract annotations (dotnet/corertdotnet/coreclr#4722) (dotne…
Browse files Browse the repository at this point in the history
…t/coreclr#14507)

Signed-off-by: dotnet-bot <[email protected]>

Commit migrated from dotnet/coreclr@a1dd9ca
  • Loading branch information
dotnet-bot authored and jkotas committed Oct 14, 2017
1 parent 8af959d commit 5edc47a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
10 changes: 0 additions & 10 deletions src/coreclr/src/mscorlib/shared/System/Byte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
**
===========================================================*/

using System.Diagnostics.Contracts;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -81,22 +80,19 @@ public override int GetHashCode()
return m_value;
}

[Pure]
public static byte Parse(String s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Parse(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.CurrentInfo);
}

[Pure]
public static byte Parse(String s, NumberStyles style)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Parse(s.AsReadOnlySpan(), style, NumberFormatInfo.CurrentInfo);
}

[Pure]
public static byte Parse(String s, IFormatProvider provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
Expand All @@ -106,7 +102,6 @@ public static byte Parse(String s, IFormatProvider provider)
// Parses an unsigned byte from a String in the given style. If
// a NumberFormatInfo isn't specified, the current culture's
// NumberFormatInfo is assumed.
[Pure]
public static byte Parse(String s, NumberStyles style, IFormatProvider provider)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
Expand Down Expand Up @@ -182,25 +177,21 @@ private static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, NumberFor
return true;
}

[Pure]
public override String ToString()
{
return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}

[Pure]
public String ToString(String format)
{
return Number.FormatInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}

[Pure]
public String ToString(IFormatProvider provider)
{
return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}

[Pure]
public String ToString(String format, IFormatProvider provider)
{
return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
Expand All @@ -209,7 +200,6 @@ public String ToString(String format, IFormatProvider provider)
//
// IConvertible implementation
//
[Pure]
public TypeCode GetTypeCode()
{
return TypeCode.Byte;
Expand Down
22 changes: 0 additions & 22 deletions src/coreclr/src/mscorlib/shared/System/Char.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
===========================================================*/

using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -129,7 +128,6 @@ public bool Equals(Char obj)
// null is considered to be less than any instance.
// If object is not of type Char, this method throws an ArgumentException.
//
[Pure]
public int CompareTo(Object value)
{
if (value == null)
Expand All @@ -144,20 +142,17 @@ public int CompareTo(Object value)
return (m_value - ((Char)value).m_value);
}

[Pure]
public int CompareTo(Char value)
{
return (m_value - value);
}

// Overrides System.Object.ToString.
[Pure]
public override String ToString()
{
return Char.ToString(m_value);
}

[Pure]
public String ToString(IFormatProvider provider)
{
return Char.ToString(m_value);
Expand All @@ -171,7 +166,6 @@ public String ToString(IFormatProvider provider)
**This static methods takes a character and returns the String representation of it.
==============================================================================*/
// Provides a string representation of a character.
[Pure]
public static string ToString(char c) => string.CreateFromChar(c);

public static char Parse(String s)
Expand Down Expand Up @@ -211,7 +205,6 @@ public static bool TryParse(String s, out Char result)
**character c is considered to be a digit. **
==============================================================================*/
// Determines whether a character is a digit.
[Pure]
public static bool IsDigit(char c)
{
if (IsLatin1(c))
Expand Down Expand Up @@ -244,7 +237,6 @@ internal static bool CheckLetter(UnicodeCategory uc)
**character c is considered to be a letter. **
==============================================================================*/
// Determines whether a character is a letter.
[Pure]
public static bool IsLetter(char c)
{
if (IsLatin1(c))
Expand Down Expand Up @@ -283,7 +275,6 @@ private static bool IsWhiteSpaceLatin1(char c)
**character c is considered to be a whitespace character. **
==============================================================================*/
// Determines whether a character is whitespace.
[Pure]
public static bool IsWhiteSpace(char c)
{
if (IsLatin1(c))
Expand All @@ -299,7 +290,6 @@ public static bool IsWhiteSpace(char c)
**Returns: True if c is an uppercase character.
==============================================================================*/
// Determines whether a character is upper-case.
[Pure]
public static bool IsUpper(char c)
{
if (IsLatin1(c))
Expand All @@ -318,7 +308,6 @@ public static bool IsUpper(char c)
**Returns: True if c is an lowercase character.
==============================================================================*/
// Determines whether a character is lower-case.
[Pure]
public static bool IsLower(char c)
{
if (IsLatin1(c))
Expand Down Expand Up @@ -354,7 +343,6 @@ internal static bool CheckPunctuation(UnicodeCategory uc)
**Returns: True if c is an punctuation mark
==============================================================================*/
// Determines whether a character is a punctuation mark.
[Pure]
public static bool IsPunctuation(char c)
{
if (IsLatin1(c))
Expand Down Expand Up @@ -383,7 +371,6 @@ internal static bool CheckLetterOrDigit(UnicodeCategory uc)
}

// Determines whether a character is a letter or a digit.
[Pure]
public static bool IsLetterOrDigit(char c)
{
if (IsLatin1(c))
Expand Down Expand Up @@ -459,7 +446,6 @@ public static char ToLowerInvariant(char c)
//
// IConvertible implementation
//
[Pure]
public TypeCode GetTypeCode()
{
return TypeCode.Char;
Expand Down Expand Up @@ -762,13 +748,11 @@ public static bool IsSeparator(String s, int index)
return (CheckSeparator(CharUnicodeInfo.GetUnicodeCategory(s, index)));
}

[Pure]
public static bool IsSurrogate(char c)
{
return (c >= HIGH_SURROGATE_START && c <= LOW_SURROGATE_END);
}

[Pure]
public static bool IsSurrogate(String s, int index)
{
if (s == null)
Expand Down Expand Up @@ -907,13 +891,11 @@ public static double GetNumericValue(String s, int index)
/*================================= IsHighSurrogate ============================
** Check if a char is a high surrogate.
==============================================================================*/
[Pure]
public static bool IsHighSurrogate(char c)
{
return ((c >= CharUnicodeInfo.HIGH_SURROGATE_START) && (c <= CharUnicodeInfo.HIGH_SURROGATE_END));
}

[Pure]
public static bool IsHighSurrogate(String s, int index)
{
if (s == null)
Expand All @@ -930,13 +912,11 @@ public static bool IsHighSurrogate(String s, int index)
/*================================= IsLowSurrogate ============================
** Check if a char is a low surrogate.
==============================================================================*/
[Pure]
public static bool IsLowSurrogate(char c)
{
return ((c >= CharUnicodeInfo.LOW_SURROGATE_START) && (c <= CharUnicodeInfo.LOW_SURROGATE_END));
}

[Pure]
public static bool IsLowSurrogate(String s, int index)
{
if (s == null)
Expand All @@ -953,7 +933,6 @@ public static bool IsLowSurrogate(String s, int index)
/*================================= IsSurrogatePair ============================
** Check if the string specified by the index starts with a surrogate pair.
==============================================================================*/
[Pure]
public static bool IsSurrogatePair(String s, int index)
{
if (s == null)
Expand All @@ -971,7 +950,6 @@ public static bool IsSurrogatePair(String s, int index)
return (false);
}

[Pure]
public static bool IsSurrogatePair(char highSurrogate, char lowSurrogate)
{
return ((highSurrogate >= CharUnicodeInfo.HIGH_SURROGATE_START && highSurrogate <= CharUnicodeInfo.HIGH_SURROGATE_END) &&
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/mscorlib/shared/System/Math.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
//This class contains only static members and doesn't require serialization.

using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
Expand Down

0 comments on commit 5edc47a

Please sign in to comment.