Skip to content

Commit 0154286

Browse files
committed
boost(DeviceCollection): Return device order by discovery
1 parent a78377c commit 0154286

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SoundSwitch.Common/Framework/Audio/Collection/DeviceCollection.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4+
using System.Linq;
45
using SoundSwitch.Common.Framework.Audio.Device;
56

67
namespace SoundSwitch.Common.Framework.Audio.Collection;
@@ -26,7 +27,7 @@ public DeviceCollection(IEnumerable<T> deviceInfos)
2627

2728
public IEnumerator<T> GetEnumerator()
2829
{
29-
return _byId.Values.GetEnumerator();
30+
return _byId.Values.OrderBy(info => info.DiscoveredAt).GetEnumerator();
3031
}
3132

3233
IEnumerator IEnumerable.GetEnumerator()

0 commit comments

Comments
 (0)