Skip to content

Commit 4420147

Browse files
1.2.14 Multicomponents store improvements
1 parent 3cdcce4 commit 4420147

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Src/MultiComponent/MultiComponent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public int IndexOf(T item) {
474474
public readonly bool Contains(T item) {
475475
var equalityComparer = EqualityComparer<T>.Default;
476476
var values = data.values[blockIdx];
477-
for (var index = dataOffset; index < dataOffset + count; ++index) {
477+
for (int index = dataOffset; index < dataOffset + count; ++index) {
478478
if (equalityComparer.Equals(values[index], item)) return true;
479479
}
480480

@@ -484,7 +484,7 @@ public readonly bool Contains(T item) {
484484
[MethodImpl(AggressiveInlining)]
485485
public readonly bool Contains<C>(T item, C comparer) where C : IEqualityComparer<T> {
486486
var values = data.values[blockIdx];
487-
for (var index = dataOffset; index < dataOffset + count; ++index) {
487+
for (int index = dataOffset; index < dataOffset + count; ++index) {
488488
if (comparer.Equals(values[index], item)) return true;
489489
}
490490

Src/World.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public abstract partial class World<WorldType> {
3333
internal static volatile bool MultiThreadActive;
3434

3535
#if FFS_ECS_DEBUG
36-
internal static MultiThreadStatus MTStatus = new() {
37-
Active = static () => MultiThreadActive
38-
};
36+
internal static MultiThreadStatus MTStatus = new(static () => MultiThreadActive);
3937
#endif
4038

4139
public static void Create(WorldConfig worldConfig) {
@@ -364,6 +362,10 @@ public enum ParallelQueryType {
364362
#if FFS_ECS_DEBUG
365363
internal struct MultiThreadStatus {
366364
public Func<bool> Active;
365+
366+
public MultiThreadStatus(Func<bool> active) {
367+
Active = active;
368+
}
367369
}
368370
#endif
369371
}

0 commit comments

Comments
 (0)