mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
Fixed devices not beeing updated
This commit is contained in:
parent
20347cf221
commit
47fd3ff203
@ -47,12 +47,13 @@ namespace RGB.NET.Core
|
|||||||
protected virtual void OnUpdate(object? sender, CustomUpdateData customData)
|
protected virtual void OnUpdate(object? sender, CustomUpdateData customData)
|
||||||
{
|
{
|
||||||
(TIdentifier, TData)[] dataSet;
|
(TIdentifier, TData)[] dataSet;
|
||||||
|
Span<(TIdentifier, TData)> data;
|
||||||
lock (_dataLock)
|
lock (_dataLock)
|
||||||
{
|
{
|
||||||
if (_currentDataSet.Count == 0) return;
|
if (_currentDataSet.Count == 0) return;
|
||||||
|
|
||||||
dataSet = ArrayPool<(TIdentifier, TData)>.Shared.Rent(_currentDataSet.Count);
|
dataSet = ArrayPool<(TIdentifier, TData)>.Shared.Rent(_currentDataSet.Count);
|
||||||
Span<(TIdentifier, TData)> data = new Span<(TIdentifier, TData)>(dataSet).Slice(0, _currentDataSet.Count);
|
data = new Span<(TIdentifier, TData)>(dataSet).Slice(0, _currentDataSet.Count);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach ((TIdentifier key, TData value) in _currentDataSet)
|
foreach ((TIdentifier key, TData value) in _currentDataSet)
|
||||||
@ -61,8 +62,7 @@ namespace RGB.NET.Core
|
|||||||
_currentDataSet.Clear();
|
_currentDataSet.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dataSet.Length != 0)
|
Update(data);
|
||||||
Update(dataSet);
|
|
||||||
|
|
||||||
ArrayPool<(TIdentifier, TData)>.Shared.Return(dataSet);
|
ArrayPool<(TIdentifier, TData)>.Shared.Return(dataSet);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user