-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Features that are used in the project and not available on NS2 (and not covered by PolySharp) have been added to the Compatibility folder. Parallel Upsert and Fetch are currently disabled on NS2, everything else should work. Fixes #116
- Loading branch information
Showing
9 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
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 @@ | ||
namespace System.Linq | ||
{ | ||
#if NETSTANDARD2_0 | ||
public static class ExtensionMethods | ||
{ | ||
public static void Deconstruct<T1, T2>(this KeyValuePair<T1, T2> tuple, out T1 key, out T2 value) | ||
{ | ||
key = tuple.Key; | ||
value = tuple.Value; | ||
} | ||
} | ||
#endif | ||
} |
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,35 @@ | ||
namespace System.Runtime.CompilerServices | ||
{ | ||
#if NETSTANDARD2_0 | ||
internal static class RuntimeHelpers | ||
{ | ||
public static T[] GetSubArray<T>(T[] array, Range range) | ||
{ | ||
if (array == null) | ||
{ | ||
throw new ArgumentNullException(); | ||
} | ||
|
||
(int offset, int length) = range.GetOffsetAndLength(array.Length); | ||
|
||
if (default(T)! != null || typeof(T[]) == array.GetType()) | ||
{ | ||
if (length == 0) | ||
{ | ||
return Array.Empty<T>(); | ||
} | ||
|
||
var dest = new T[length]; | ||
Array.Copy(array, offset, dest, 0, length); | ||
return dest; | ||
} | ||
else | ||
{ | ||
T[] dest = (T[])Array.CreateInstance(array.GetType().GetElementType()!, length); | ||
Array.Copy(array, offset, dest, 0, length); | ||
return dest; | ||
} | ||
} | ||
} | ||
#endif | ||
} |
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
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
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
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
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
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
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