Skip to content

Commit 8b7fc84

Browse files
Copilotkjy5
andcommitted
Optimize OnSceneStateChanged to use for-loop
Co-authored-by: kjy5 <[email protected]>
1 parent 8bc5bf6 commit 8b7fc84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Assets/Scripts/Services/EphysLinkService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ public EphysLinkService(StoreService storeService)
9494
private async void OnSceneStateChanged(SceneState sceneState)
9595
{
9696
// Handle demo loop state changes.
97-
foreach (var manipulatorState in sceneState.Manipulators)
97+
for (int i = 0; i < sceneState.Manipulators.Count; i++)
9898
{
99+
var manipulatorState = sceneState.Manipulators[i];
99100
var isRunning = _runningDemoLoops.Contains(manipulatorState.Id);
100101

101102
switch (manipulatorState.IsDemoRunning)

0 commit comments

Comments
 (0)