Skip to content

Commit

Permalink
Revert "Use Array.Empty() if available."
Browse files Browse the repository at this point in the history
This reverts commit f4393f4.
  • Loading branch information
Drake53 authored and mmanela committed Jan 6, 2023
1 parent 5266e94 commit 99868e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
8 changes: 2 additions & 6 deletions DiffPlex/Chunkers/LineEndingsPreservingChunker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ namespace DiffPlex.Chunkers
{
public class LineEndingsPreservingChunker:IChunker
{
#if NETSTANDARD1_3_OR_GREATER || NET46_OR_GREATER || NETCOREAPP
private static readonly string[] emptyStringArray = System.Array.Empty<string>();
#else
private static readonly string[] emptyStringArray = new string[0];
#endif
private readonly string[] emptyArray = new string[0];

/// <summary>
/// Gets the default singleton instance of the chunker.
Expand All @@ -18,7 +14,7 @@ public class LineEndingsPreservingChunker:IChunker
public string[] Chunk(string text)
{
if (string.IsNullOrEmpty(text))
return emptyStringArray;
return emptyArray;

var output = new List<string>();
var lastCut = 0;
Expand Down
5 changes: 1 addition & 4 deletions DiffPlex/Differ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ namespace DiffPlex
{
public class Differ : IDiffer
{
#if NETSTANDARD1_3_OR_GREATER || NET46_OR_GREATER || NETCOREAPP
private static readonly string[] emptyStringArray = Array.Empty<string>();
#else

private static readonly string[] emptyStringArray = new string[0];
#endif

/// <summary>
/// Gets the default singleton instance of differ instance.
Expand Down

0 comments on commit 99868e2

Please sign in to comment.