Skip to content

Commit

Permalink
perf: Remove foreach statement in SubscribeToPropertyChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Apr 9, 2021
1 parent 2d02800 commit 5f0aed5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Uno.UI/DataBinding/BindingPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,10 @@ private void RaiseValueChanged(object newValue)
private IDisposable SubscribeToPropertyChanged(PropertyChangedHandler action)
{
var disposables = new CompositeDisposable((_propertyChangedHandlers.Count * 3));
foreach (var handler in _propertyChangedHandlers)

for (var i = 0; i < _propertyChangedHandlers.Count; i++)
{
var handler = _propertyChangedHandlers[i];
object previousValue = default;

Action updateProperty = () =>
Expand Down

0 comments on commit 5f0aed5

Please sign in to comment.