Code cleanup.

This commit is contained in:
2023-01-21 16:59:19 +08:00
parent c5dab3a232
commit 6779b88055
2 changed files with 4 additions and 4 deletions

View File

@@ -145,7 +145,7 @@ namespace Cryville.Common {
/// <returns>An array containing all the subclasses of the type in the current app domain.</returns> /// <returns>An array containing all the subclasses of the type in the current app domain.</returns>
public static Type[] GetSubclassesOf<T>() where T : class { public static Type[] GetSubclassesOf<T>() where T : class {
var assemblies = AppDomain.CurrentDomain.GetAssemblies(); var assemblies = AppDomain.CurrentDomain.GetAssemblies();
IEnumerable<Type> r = new List<Type>(); IEnumerable<Type> r = Enumerable.Empty<Type>();
foreach (var a in assemblies) foreach (var a in assemblies)
r = r.Concat(a.GetTypes().Where( r = r.Concat(a.GetTypes().Where(
t => t.IsClass t => t.IsClass

View File

@@ -11,8 +11,8 @@ namespace Cryville.Crtr.Event {
Dictionary<EventContainer, ContainerState> states Dictionary<EventContainer, ContainerState> states
= new Dictionary<EventContainer, ContainerState>(); = new Dictionary<EventContainer, ContainerState>();
List<EventContainer> activeContainers HashSet<EventContainer> activeContainers
= new List<EventContainer>(); = new HashSet<EventContainer>();
HashSet<ContainerState> workingStates HashSet<ContainerState> workingStates
= new HashSet<ContainerState>(); = new HashSet<ContainerState>();
HashSet<ContainerState> invalidatedStates HashSet<ContainerState> invalidatedStates
@@ -29,7 +29,7 @@ namespace Cryville.Crtr.Event {
var r = (EventBus)MemberwiseClone(); var r = (EventBus)MemberwiseClone();
r.prototype = this; r.prototype = this;
r.states = new Dictionary<EventContainer, ContainerState>(); r.states = new Dictionary<EventContainer, ContainerState>();
r.activeContainers = new List<EventContainer>(); r.activeContainers = new HashSet<EventContainer>();
r.workingStates = new HashSet<ContainerState>(); r.workingStates = new HashSet<ContainerState>();
r.invalidatedStates = new HashSet<ContainerState>(); r.invalidatedStates = new HashSet<ContainerState>();
r.tempEvents = new List<StampedEvent>(); r.tempEvents = new List<StampedEvent>();