diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Guid.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Guid.cs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Guid.cs b/src/System.Private.CoreLib/shared/System/Guid.cs index 423d5bc78..6e6ec067a 100644 --- a/src/System.Private.CoreLib/shared/System/Guid.cs +++ b/src/System.Private.CoreLib/shared/System/Guid.cs @@ -279,7 +279,7 @@ namespace System { if (input == null) { - result = default(Guid); + result = default; return false; } @@ -297,7 +297,7 @@ namespace System } else { - result = default(Guid); + result = default; return false; } } @@ -358,7 +358,7 @@ namespace System { if (input == null) { - result = default(Guid); + result = default; return false; } @@ -369,7 +369,7 @@ namespace System { if (format.Length != 1) { - result = default(Guid); + result = default; return false; } @@ -398,7 +398,7 @@ namespace System break; default: // invalid guid format specification - result = default(Guid); + result = default; return false; } @@ -411,7 +411,7 @@ namespace System } else { - result = default(Guid); + result = default; return false; } } @@ -427,7 +427,7 @@ namespace System } // Check for dashes - bool dashesExistInString = guidString.IndexOf('-') >= 0; + bool dashesExistInString = guidString.Contains('-'); if (dashesExistInString) { @@ -449,7 +449,7 @@ namespace System } // Check for braces - bool bracesExistInString = (guidString.IndexOf('{', 0) >= 0); + bool bracesExistInString = guidString.Contains('{'); if (bracesExistInString) { @@ -471,7 +471,7 @@ namespace System } // Check for parenthesis - bool parenthesisExistInString = (guidString.IndexOf('(', 0) >= 0); + bool parenthesisExistInString = guidString.Contains('('); if (parenthesisExistInString) { @@ -548,7 +548,7 @@ namespace System // Find the end of this hex number (since it is not fixed length) numStart = 3; - numLen = guidString.IndexOf(',', numStart) - numStart; + numLen = guidString.Slice(numStart).IndexOf(','); if (numLen <= 0) { result.SetFailure(ParseFailureKind.Format, nameof(SR.Format_GuidComma)); @@ -566,7 +566,7 @@ namespace System } // +3 to get by ',0x' numStart = numStart + numLen + 3; - numLen = guidString.IndexOf(',', numStart) - numStart; + numLen = guidString.Slice(numStart).IndexOf(','); if (numLen <= 0) { result.SetFailure(ParseFailureKind.Format, nameof(SR.Format_GuidComma)); @@ -584,7 +584,7 @@ namespace System } // +3 to get by ',0x' numStart = numStart + numLen + 3; - numLen = guidString.IndexOf(',', numStart) - numStart; + numLen = guidString.Slice(numStart).IndexOf(','); if (numLen <= 0) { result.SetFailure(ParseFailureKind.Format, nameof(SR.Format_GuidComma)); @@ -621,7 +621,7 @@ namespace System // Calculate number length if (i < 7) // first 7 cases { - numLen = guidString.IndexOf(',', numStart) - numStart; + numLen = guidString.Slice(numStart).IndexOf(','); if (numLen <= 0) { result.SetFailure(ParseFailureKind.Format, nameof(SR.Format_GuidComma)); @@ -630,7 +630,7 @@ namespace System } else // last case ends with '}', not ',' { - numLen = guidString.IndexOf('}', numStart) - numStart; + numLen = guidString.Slice(numStart).IndexOf('}'); if (numLen <= 0) { result.SetFailure(ParseFailureKind.Format, nameof(SR.Format_GuidBraceAfterLastNumber)); @@ -1232,7 +1232,7 @@ namespace System return (char)((a > 9) ? a - 10 + 0x61 : a + 0x30); } - unsafe private static int HexsToChars(char* guidChars, int a, int b) + private static unsafe int HexsToChars(char* guidChars, int a, int b) { guidChars[0] = HexToChar(a >> 4); guidChars[1] = HexToChar(a); @@ -1243,7 +1243,7 @@ namespace System return 4; } - unsafe private static int HexsToCharsHexOutput(char* guidChars, int a, int b) + private static unsafe int HexsToCharsHexOutput(char* guidChars, int a, int b) { guidChars[0] = '0'; guidChars[1] = 'x'; |