Browse Source

Don't add duplicate frames.

refactor/style-priorities
Steven Kirk 4 years ago
parent
commit
79115bd199
  1. 2
      src/Avalonia.Base/PropertyStore/ValueStore.cs

2
src/Avalonia.Base/PropertyStore/ValueStore.cs

@ -141,7 +141,6 @@ namespace Avalonia.PropertyStore
{ {
var frame = GetOrCreateImmediateValueFrame(property, priority); var frame = GetOrCreateImmediateValueFrame(property, priority);
result = frame.AddValue(property, value); result = frame.AddValue(property, value);
InsertFrame(frame);
} }
if (TryGetEffectiveValue(property, out var existing)) if (TryGetEffectiveValue(property, out var existing))
@ -528,6 +527,7 @@ namespace Avalonia.PropertyStore
private void InsertFrame(IValueFrame frame) private void InsertFrame(IValueFrame frame)
{ {
Debug.Assert(!_frames.Contains(frame));
var index = _frames.BinarySearch(frame, FrameInsertionComparer.Instance); var index = _frames.BinarySearch(frame, FrameInsertionComparer.Instance);
if (index < 0) if (index < 0)
index = ~index; index = ~index;

Loading…
Cancel
Save