Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Feb 20, 2024
1 parent 3deec57 commit 0ebd42b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Consume/Consume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Consume
Debug.Log("Test log to make sure this is working");
}

#if HTTPREFERENCED
#if FetureHttp

static void Http()
{
Expand Down
5 changes: 1 addition & 4 deletions src/Polyfill/Polyfill.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<PropertyGroup>
<PrepareForBuildDependsOn>$(PrepareForBuildDependsOn);PreparePolyfill</PrepareForBuildDependsOn>
<TasksExtensionsReferenced>false</TasksExtensionsReferenced>
<HttpReferenced>false</HttpReferenced>
<LowerFramework>$(TargetFramework.ToLower())</LowerFramework>
</PropertyGroup>
<PropertyGroup Condition="$(AllowUnsafeBlocks) == 'true' ">
Expand Down Expand Up @@ -42,10 +41,8 @@
<DefineConstants
Condition="$(TasksExtensionsReferenced)">$(DefineConstants);TASKSEXTENSIONSREFERENCED</DefineConstants>

<HttpReferenced
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Net.Http')->Count()) != 0 OR @(Reference->WithMetadataValue('Identity', 'System.Net.Http')->Count()) != 0">true</HttpReferenced>
<DefineConstants
Condition="$(HttpReferenced)">$(DefineConstants);HTTPREFERENCED</DefineConstants>
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Net.Http')->Count()) != 0 OR @(Reference->WithMetadataValue('Identity', 'System.Net.Http')->Count()) != 0">$(DefineConstants);FetureHttp</DefineConstants>

<DefineConstants Condition="$(LowerFramework.StartsWith('net9'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net8'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/Polyfill_HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma warning disable

#if ((NETFRAMEWORK && HTTPREFERENCED) || NETSTANDARD || NETCOREAPP2X || NETCOREAPP3X)
#if ((NETFRAMEWORK && FetureHttp) || NETSTANDARD || NETCOREAPP2X || NETCOREAPP3X)

using System;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/Polyfill_HttpContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma warning disable

#if ((NETFRAMEWORK && HTTPREFERENCED) || NETSTANDARD || NETCOREAPP2X || NETCOREAPP3X)
#if ((NETFRAMEWORK && FetureHttp) || NETSTANDARD || NETCOREAPP2X || NETCOREAPP3X)

using System.IO;
using System.Net.Http;
Expand Down
10 changes: 5 additions & 5 deletions src/Polyfill/StringPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static partial class StringPolyfill
public static string Join(char separator, string[] values)
{
#if NETSTANDARD2_0 || NETFRAMEWORK
return string.Join(new(new[]{separator}), values);
return string.Join(new([separator]), values);
#else
return string.Join(separator, values);
#endif
Expand All @@ -27,16 +27,16 @@ public static string Join(char separator, string[] values)
public static string Join(char separator, object[] values)
{
#if NETSTANDARD2_0 || NETFRAMEWORK
return string.Join(new(new[]{separator}), values);
return string.Join(new([separator]), values);
#else
return string.Join(separator, values);
#endif
}

public static string Join (char separator, string?[] value, int startIndex, int count)
public static string Join(char separator, string?[] value, int startIndex, int count)
{
#if NETSTANDARD2_0 || NETFRAMEWORK
return string.Join(new(new[]{separator}), value, startIndex, count);
return string.Join(new([separator]), value, startIndex, count);
#else
return string.Join(separator, value, startIndex, count);
#endif
Expand All @@ -45,7 +45,7 @@ public static string Join (char separator, string?[] value, int startIndex, int
public static string Join<T> (char separator, IEnumerable<T> values)
{
#if NETSTANDARD2_0 || NETFRAMEWORK
return string.Join(new(new[]{separator}), values);
return string.Join(new([separator]), values);
#else
return string.Join(separator, values);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/StringPolyfillTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ partial class StringPolyfillTest
[Test]
public void Join()
{
Assert.AreEqual("bac", StringPolyfill.Join('a', new []{"b","c"}));
Assert.AreEqual("bac", StringPolyfill.Join('a', ["b","c"]));
Assert.AreEqual("bac", StringPolyfill.Join('a', new object[]{"b","c"}));
}
}

0 comments on commit 0ebd42b

Please sign in to comment.