Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
text = null - retrun false
  • Loading branch information
maxkoshevoi committed Aug 15, 2021
commit d6010db4de63cbcb07d35bd42c4b1072940e167d
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public partial interface IChangeToken
public static bool Equals(Microsoft.Extensions.Primitives.StringSegment a, Microsoft.Extensions.Primitives.StringSegment b, System.StringComparison comparisonType) { throw null; }
public bool Equals(Microsoft.Extensions.Primitives.StringSegment other, System.StringComparison comparisonType) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? obj) { throw null; }
public bool Equals(string? text) { throw null; }
public bool Equals(string text, System.StringComparison comparisonType) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] string? text) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] string? text, System.StringComparison comparisonType) { throw null; }
public override int GetHashCode() { throw null; }
public int IndexOf(char c) { throw null; }
public int IndexOf(char c, int start) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static bool Equals(StringSegment a, StringSegment b, StringComparison com
/// </summary>
/// <param name="text">The <see cref="string"/> to compare with the current <see cref="StringSegment"/>.</param>
/// <returns><see langword="true" /> if the specified <see cref="string"/> is equal to the current <see cref="StringSegment"/>; otherwise, <see langword="false" />.</returns>
public bool Equals(string text)
public bool Equals([NotNullWhen(true)] string? text)
{
return Equals(text, StringComparison.Ordinal);
}
Expand All @@ -256,11 +256,11 @@ public bool Equals(string text)
/// <paramref name="text"/> is <see langword="null" />.
/// </exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(string text, StringComparison comparisonType)
public bool Equals([NotNullWhen(true)] string? text, StringComparison comparisonType)
{
if (text == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.text);
return false;
}

if (!HasValue)
Expand Down