Skip to content

Commit 61f5cf8

Browse files
committed
Use Empty from BeatyBit.Bits
1 parent ba53f4a commit 61f5cf8

18 files changed

Lines changed: 60 additions & 76 deletions

File tree

src/Armature.Core/src/BuildSession/BuildSession.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Runtime.ExceptionServices;
55
using BeatyBit.Armature.Core.Sdk;
6+
using BeatyBit.Bits;
67

78
namespace BeatyBit.Armature.Core;
89

@@ -39,7 +40,7 @@ public BuildSession(object[] buildStages, IBuildStackPattern patternTree, IBuild
3940

4041
_mainBuildStackPatternTree = patternTree ?? throw new ArgumentNullException(nameof(patternTree));
4142
_auxPatternTree = auxPatternTree;
42-
_parentBuilders = parentBuilders ?? Empty<IBuilder>.Array;
43+
_parentBuilders = parentBuilders ?? [];
4344
}
4445

4546
/// <inheritdoc cref="IBuildSession.BuildUnit"/>

src/Armature.Core/src/BuildSession/IBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using BeatyBit.Armature.Core.Sdk;
3+
using BeatyBit.Bits;
34

45
namespace BeatyBit.Armature.Core;
56

@@ -26,7 +27,7 @@ public interface IBuilder
2627
/// <param name="engageParentBuilders">Determines whether to build a unit via parent builders in case it's not built in the scope of
2728
/// the current Builder.
2829
/// Default: true. </param>
29-
/// <returns>Returns <see cref="Empty{BuildResult}.List"/> if no units were built. </returns>
30+
/// <returns>Returns <see cref="Empty{T}.List"/> if no units were built. </returns>
3031
List<Weighted<BuildResult>> BuildAllUnits(UnitId unitId, IBuildStackPattern? auxBuildStackPatternTree = null, bool engageParentBuilders = true);
3132

3233
string Name { get; }

src/Armature.Core/src/BuildStackPatterns/BuildStackPatternBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Diagnostics;
55
using System.Runtime.CompilerServices;
66
using BeatyBit.Armature.Core.Sdk;
7+
using BeatyBit.Bits;
78
using JetBrains.Annotations;
89

910
namespace BeatyBit.Armature.Core;

src/Armature.Core/src/BuildStackPatterns/BuildStackPatternTree.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Diagnostics;
55
using System.Linq;
66
using BeatyBit.Armature.Core.Sdk;
7+
using BeatyBit.Bits;
78

89
namespace BeatyBit.Armature.Core;
910

@@ -185,4 +186,4 @@ HashSet<IBuildStackPattern> IInternal<long, HashSet<IBuildStackPattern>?>.Member
185186
=> _staticMap;
186187

187188
#endregion
188-
}
189+
}

src/Armature.Core/src/Exception/ExceptionConst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace BeatyBit.Armature.Core;
44

55
[PublicAPI]
6-
public static class ExceptionConst
6+
public class ExceptionConst
77
{
88
public const string ArmaturePrefix = "Armature_";
99

src/Armature.Core/src/Logging/Log.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace BeatyBit.Armature.Core;
1313
/// so add a listener to see the log.
1414
/// </summary>
1515
[PublicAPI]
16-
public static class Log
16+
public class Log
1717
{
1818
private static DeferredLogScope? _activeDeferredScope;
1919

src/Armature.Core/src/Logging/LogConst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace BeatyBit.Armature.Core;
44

5-
public static class LogConst
5+
public class LogConst
66
{
77
public const string Matched = "Matched: {0}";
88

src/Armature.Core/src/Sdk/Empty.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Armature.Core/src/Sdk/Static.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using System.Runtime.CompilerServices;
2+
using JetBrains.Annotations;
23

34
namespace BeatyBit.Armature.Core.Sdk;
45

56
/// <summary>
67
/// Generic approach of creating singleton instances of a type when needed.
78
/// </summary>
8-
public static class Static
9+
[PublicAPI]
10+
public class Static
911
{
1012
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1113
public static T Of<T>() where T : new()

src/Armature/src/BuildActions/Creation/CreateByReflection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Runtime.ExceptionServices;
44
using BeatyBit.Armature.Core.Annotations;
55
using BeatyBit.Armature.Core;
6-
using BeatyBit.Armature.Core.Sdk;
76
using BeatyBit.Armature.Sdk;
87

98
namespace BeatyBit.Armature;
@@ -25,7 +24,7 @@ public void Process(IBuildSession buildSession)
2524
if(parameters.Length == 0 && type.IsValueType) // do not create default value of a value type, it can confuse business logic
2625
return;
2726

28-
var arguments = parameters.Length == 0 ? Empty<object>.Array : buildSession.BuildArgumentsForMethod(parameters);
27+
var arguments = parameters.Length == 0 ? [] : buildSession.BuildArgumentsForMethod(parameters);
2928
try
3029
{
3130
var instance = constructor.Invoke(arguments);

0 commit comments

Comments
 (0)