Skip to content

Commit 1e65044

Browse files
sblomAndrew Gibson
authored andcommitted
Remove obsolete PORTABLE and IS_CORECLR defines
1 parent 01c644f commit 1e65044

File tree

6 files changed

+0
-41
lines changed

6 files changed

+0
-41
lines changed

src/json-ld.net/Core/Context.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ namespace JsonLD.Core
1414
/// <author>tristan</author>
1515
//[System.Serializable]
1616
public class Context : JObject
17-
#if !PORTABLE && !IS_CORECLR
18-
, ICloneable
19-
#endif
2017
{
2118
private JsonLdOptions options;
2219

src/json-ld.net/Core/JsonLdApi.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,6 @@ public virtual RDFDataset ToRDF()
21962196
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
21972197
public virtual object Normalize(RDFDataset dataset)
21982198
{
2199-
#if !PORTABLE
22002199
// create quads and map bnodes to their associated quads
22012200
IList<RDFDataset.Quad> quads = new List<RDFDataset.Quad>();
22022201
IDictionary<string,IDictionary<string,object>> bnodes = new Dictionary<string,IDictionary<string,object>>();
@@ -2247,9 +2246,6 @@ public virtual object Normalize(RDFDataset dataset)
22472246
NormalizeUtils normalizeUtils = new NormalizeUtils(quads, bnodes, new UniqueNamer
22482247
("_:c14n"), opts);
22492248
return normalizeUtils.HashBlankNodes(bnodes.Keys);
2250-
#else
2251-
throw new PlatformNotSupportedException();
2252-
#endif
22532249
}
22542250
}
22552251
}

src/json-ld.net/Core/JsonLdProcessor.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,24 +487,16 @@ public static object ToRDF(JToken input)
487487
/// <exception cref="JsonLDNet.Core.JsonLdError"></exception>
488488
public static object Normalize(JToken input, JsonLdOptions options)
489489
{
490-
#if !PORTABLE
491490
JsonLdOptions opts = options.Clone();
492491
opts.format = null;
493492
RDFDataset dataset = (RDFDataset)ToRDF(input, opts);
494493
return new JsonLdApi(options).Normalize(dataset);
495-
#else
496-
throw new PlatformNotSupportedException();
497-
#endif
498494
}
499495

500496
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
501497
public static object Normalize(JToken input)
502498
{
503-
#if !PORTABLE
504499
return Normalize(input, new JsonLdOptions(string.Empty));
505-
#else
506-
throw new PlatformNotSupportedException();
507-
#endif
508500
}
509501
}
510502
}

src/json-ld.net/Core/NormalizeUtils.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public NormalizeUtils(IList<RDFDataset.Quad> quads, IDictionary<string, IDiction
2929
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
3030
public virtual object HashBlankNodes(IEnumerable<string> unnamed_)
3131
{
32-
#if !PORTABLE
3332
IList<string> unnamed = new List<string>(unnamed_);
3433
IList<string> nextUnnamed = new List<string>();
3534
IDictionary<string, IList<string>> duplicates = new Dictionary<string, IList<string
@@ -203,9 +202,6 @@ public virtual object HashBlankNodes(IEnumerable<string> unnamed_)
203202
}
204203
}
205204
}
206-
#else
207-
throw new PlatformNotSupportedException();
208-
#endif
209205
}
210206

211207
private sealed class _IComparer_145 : IComparer<NormalizeUtils.HashResult>
@@ -245,7 +241,6 @@ private class HashResult
245241
/// <param name="callback">(err, result) called once the operation completes.</param>
246242
private static NormalizeUtils.HashResult HashPaths(string id, IDictionary<string, IDictionary<string, object>> bnodes, UniqueNamer namer, UniqueNamer pathNamer)
247243
{
248-
#if !PORTABLE
249244
MessageDigest md = null;
250245

251246
try
@@ -460,9 +455,6 @@ private static NormalizeUtils.HashResult HashPaths(string id, IDictionary<string
460455
{
461456
md?.Dispose();
462457
}
463-
#else
464-
throw new PlatformNotSupportedException();
465-
#endif
466458
}
467459

468460
/// <summary>Hashes all of the quads about a blank node.</summary>
@@ -500,7 +492,6 @@ private static string HashQuads(string id, IDictionary<string, IDictionary<strin
500492
/// <returns></returns>
501493
private static string Sha1hash(ICollection<string> nquads)
502494
{
503-
#if !PORTABLE
504495
try
505496
{
506497
// create SHA-1 digest
@@ -515,9 +506,6 @@ private static string Sha1hash(ICollection<string> nquads)
515506
{
516507
throw;
517508
}
518-
#else
519-
throw new PlatformNotSupportedException();
520-
#endif
521509
}
522510

523511
// TODO: this is something to optimize

src/json-ld.net/Util/JavaCompat.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
using System.Linq;
77
using System.Text;
88
using System.Text.RegularExpressions;
9-
10-
#if !PORTABLE
119
using System.Security.Cryptography;
12-
#endif
1310

1411
namespace JsonLD
1512
{
@@ -281,13 +278,7 @@ public Matcher Matcher(string str)
281278

282279
public string GetPattern()
283280
{
284-
#if !PORTABLE && !IS_CORECLR
285-
return this.pattern;
286-
#elif !PORTABLE
287281
return _rx;
288-
#else
289-
throw new PlatformNotSupportedException();
290-
#endif
291282
}
292283

293284
new public static bool Matches(string val, string rx)
@@ -357,7 +348,6 @@ public bool Find()
357348
}
358349

359350

360-
#if !PORTABLE
361351
internal class MessageDigest : IDisposable
362352
{
363353
SHA1 md;
@@ -392,5 +382,4 @@ public void Dispose()
392382
md.Dispose();
393383
}
394384
}
395-
#endif
396385
}

src/json-ld.net/json-ld.net.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ Implements the W3C JSON-LD 1.0 standard.</Description>
1919
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
2020
<RepositoryUrl>https://github.com/linked-data-dotnet/json-ld.net</RepositoryUrl>
2121
</PropertyGroup>
22-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
23-
<DefineConstants>$(DefineConstants);IS_CORECLR</DefineConstants>
24-
</PropertyGroup>
2522
<ItemGroup>
2623
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
2724
</ItemGroup>

0 commit comments

Comments
 (0)