Browse Source

Fixed preprocessor directives

tags/v0.8.0
Udayshankar Ravikumar 2 years ago
parent
commit
df310e15da
5 changed files with 9 additions and 9 deletions
  1. +2
    -2
      LLama/Extensions/DictionaryExtensions.cs
  2. +2
    -2
      LLama/Extensions/EncodingExtensions.cs
  3. +2
    -2
      LLama/Extensions/IEnumerableExtensions.cs
  4. +2
    -2
      LLama/Extensions/KeyValuePairExtensions.cs
  5. +1
    -1
      LLama/Extensions/ListExtensions.cs

+ 2
- 2
LLama/Extensions/DictionaryExtensions.cs View File

@@ -4,12 +4,12 @@ namespace LLama.Extensions
{ {
internal static class DictionaryExtensions internal static class DictionaryExtensions
{ {
#if NETSTANDARD2_0_OR_GREATER
#if NETSTANDARD2_0
public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue) public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue)
{ {
return GetValueOrDefaultImpl(dictionary, key, defaultValue); return GetValueOrDefaultImpl(dictionary, key, defaultValue);
} }
#elif !NET6_0_OR_GREATER
#elif !NET6_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER
#error Target framework not supported! #error Target framework not supported!
#endif #endif




+ 2
- 2
LLama/Extensions/EncodingExtensions.cs View File

@@ -5,7 +5,7 @@ namespace LLama.Extensions;


internal static class EncodingExtensions internal static class EncodingExtensions
{ {
#if NETSTANDARD2_0_OR_GREATER
#if NETSTANDARD2_0
public static int GetChars(this Encoding encoding, ReadOnlySpan<byte> bytes, Span<char> output) public static int GetChars(this Encoding encoding, ReadOnlySpan<byte> bytes, Span<char> output)
{ {
return GetCharsImpl(encoding, bytes, output); return GetCharsImpl(encoding, bytes, output);
@@ -15,7 +15,7 @@ internal static class EncodingExtensions
{ {
return GetCharCountImpl(encoding, bytes); return GetCharCountImpl(encoding, bytes);
} }
#elif !NET6_0_OR_GREATER
#elif !NET6_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER
#error Target framework not supported! #error Target framework not supported!
#endif #endif




+ 2
- 2
LLama/Extensions/IEnumerableExtensions.cs View File

@@ -5,12 +5,12 @@ namespace LLama.Extensions
{ {
internal static class IEnumerableExtensions internal static class IEnumerableExtensions
{ {
#if NETSTANDARD2_0_OR_GREATER
#if NETSTANDARD2_0
public static IEnumerable<T> TakeLast<T>(this IEnumerable<T> source, int count) public static IEnumerable<T> TakeLast<T>(this IEnumerable<T> source, int count)
{ {
return TakeLastImpl(source, count); return TakeLastImpl(source, count);
} }
#elif !NET6_0_OR_GREATER
#elif !NET6_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER
#error Target framework not supported! #error Target framework not supported!
#endif #endif




+ 2
- 2
LLama/Extensions/KeyValuePairExtensions.cs View File

@@ -5,7 +5,7 @@
/// </summary> /// </summary>
internal static class KeyValuePairExtensions internal static class KeyValuePairExtensions
{ {
#if NETSTANDARD2_0_OR_GREATER
#if NETSTANDARD2_0
/// <summary> /// <summary>
/// Deconstruct a KeyValuePair into it's constituent parts. /// Deconstruct a KeyValuePair into it's constituent parts.
/// </summary> /// </summary>
@@ -19,7 +19,7 @@ internal static class KeyValuePairExtensions
first = pair.Key; first = pair.Key;
second = pair.Value; second = pair.Value;
} }
#elif !NET6_0_OR_GREATER
#elif !NET6_0_OR_GREATER && !NETSTANDARD2_1_OR_GREATER
#error Target framework not supported! #error Target framework not supported!
#endif #endif
} }

+ 1
- 1
LLama/Extensions/ListExtensions.cs View File

@@ -5,7 +5,7 @@ namespace LLama.Extensions
{ {
internal static class ListExtensions internal static class ListExtensions
{ {
#if NETSTANDARD2_0_OR_GREATER
#if NETSTANDARD2_0 || NETSTANDARD2_1
public static void EnsureCapacity<T>(this List<T> list, int capacity) public static void EnsureCapacity<T>(this List<T> list, int capacity)
{ {
if (list.Capacity < capacity) if (list.Capacity < capacity)


Loading…
Cancel
Save