Browse Source

Reduced memory alloc for combined binding subjects (#16794)

pull/16800/head
Yoh Deadfall 2 years ago
committed by GitHub
parent
commit
e627821ed3
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Avalonia.Base/Data/InstancedBinding.cs

2
src/Avalonia.Base/Data/InstancedBinding.cs

@ -155,7 +155,7 @@ namespace Avalonia.Data
_ = observable ?? throw new ArgumentNullException(nameof(observable));
_ = observer ?? throw new ArgumentNullException(nameof(observer));
var subject = new CombinedSubject<object?>(observer, observable);
var subject = observable == observer ? observable : new CombinedSubject<object?>(observer, observable);
return new InstancedBinding(subject, BindingMode.TwoWay, priority);
}

Loading…
Cancel
Save