Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change IComparer interface argument so that it accepts nulls. #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Semver/Comparers/ISemVersionComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ namespace Semver.Comparers;
/// <see cref="SemVersion.SortOrderComparer"/> so that separate properties aren't needed for the
/// <see cref="IEqualityComparer{T}"/> and <see cref="IComparer{T}"/> of <see cref="SemVersion"/>.
/// </remarks>
public interface ISemVersionComparer : IEqualityComparer<SemVersion>, IComparer<SemVersion>, IComparer
public interface ISemVersionComparer : IEqualityComparer<SemVersion>, IComparer<SemVersion?>, IComparer
{
}
4 changes: 2 additions & 2 deletions Semver/Comparers/PrecedenceComparer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System;
using System.Collections.Generic;

namespace Semver.Comparers;

internal sealed class PrecedenceComparer : Comparer<SemVersion>, ISemVersionComparer
internal sealed class PrecedenceComparer : Comparer<SemVersion?>, ISemVersionComparer
{
#region Singleton
public static readonly ISemVersionComparer Instance = new PrecedenceComparer();
Expand Down
4 changes: 2 additions & 2 deletions Semver/Comparers/SortOrderComparer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using Semver.Utility;

namespace Semver.Comparers;

internal sealed class SortOrderComparer : Comparer<SemVersion>, ISemVersionComparer
internal sealed class SortOrderComparer : Comparer<SemVersion?>, ISemVersionComparer
{
#region Singleton
public static readonly ISemVersionComparer Instance = new SortOrderComparer();
Expand Down
2 changes: 1 addition & 1 deletion Semver/Comparers/UnbrokenSemVersionRangeComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Semver.Comparers;
/// the ranges they contain will be removed. Note that the <see cref="SemVersionRange"/> API
/// will never expose this order exactly because contained ranges will not be included in the
/// final <see cref="SemVersionRange"/>.</remarks>
internal sealed class UnbrokenSemVersionRangeComparer : Comparer<UnbrokenSemVersionRange>
internal sealed class UnbrokenSemVersionRangeComparer : Comparer<UnbrokenSemVersionRange?>
{
#region Singleton
public static readonly UnbrokenSemVersionRangeComparer Instance = new();
Expand Down