-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
32 additions
and
25 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
src/core-taggeds-optional/Optional/Optional.T.Comparer/Optional.T.Comparer.cs
This file was deleted.
Oops, something went wrong.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
...e-taggeds-optional/Optional/Optional.T/Internal.Comparison/Optional.T.InternalComparer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace System; | ||
|
||
partial struct Optional<T> | ||
{ | ||
internal sealed class InternalComparer(IComparer<T> comparer) : IComparer<Optional<T>> | ||
{ | ||
public int Compare(Optional<T> x, Optional<T> y) | ||
=> | ||
x.InternalCompareTo(y, comparer); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/core-taggeds-optional/Optional/Optional.T/Optional.T.Comparison.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace System; | ||
|
||
partial struct Optional<T> | ||
{ | ||
// TODO: Add the tests and open the method | ||
internal static IComparer<Optional<T>> CreateComparer(IComparer<T> comparer) | ||
=> | ||
new InternalComparer(comparer ?? throw new ArgumentNullException(nameof(comparer))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters