-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggested change to clean up CA warnings (#87)
- Loading branch information
Showing
3 changed files
with
31 additions
and
15 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
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,21 @@ | ||
namespace Moq.AutoMock.Resolvers | ||
{ | ||
#if NET45 | ||
//Array.Empty does not exist in net45 | ||
//This duplicates what was added to .NET Core | ||
internal static class Array | ||
{ | ||
public static T[] Empty<T>() | ||
{ | ||
return EmptyArray<T>.Value; | ||
} | ||
|
||
private static class EmptyArray<T> | ||
{ | ||
#pragma warning disable CA1825 // this is the implementation of Array.Empty<T>() | ||
internal static readonly T[] Value = new T[0]; | ||
#pragma warning restore CA1825 | ||
} | ||
} | ||
#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