Simon Cropp
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
4 additions and
8 deletions
-
src/Avalonia.Base/Collections/AvaloniaDictionary.cs
-
src/Avalonia.Base/Controls/NameScope.cs
-
src/Avalonia.Base/Media/MediaContext.cs
-
src/Avalonia.Base/Utilities/SmallDictionary.cs
|
|
|
@ -167,9 +167,8 @@ namespace Avalonia.Collections |
|
|
|
/// <inheritdoc/>
|
|
|
|
public bool Remove(TKey key) |
|
|
|
{ |
|
|
|
if (_inner.TryGetValue(key, out var value)) |
|
|
|
if (_inner.Remove(key, out var value)) |
|
|
|
{ |
|
|
|
_inner.Remove(key); |
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Count))); |
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs($"{CommonPropertyNames.IndexerName}[{key}]")); |
|
|
|
|
|
|
|
|
|
|
|
@ -68,9 +68,8 @@ namespace Avalonia.Controls |
|
|
|
else |
|
|
|
{ |
|
|
|
_inner.Add(name, element); |
|
|
|
if (_pendingSearches.TryGetValue(name, out var tcs)) |
|
|
|
if (_pendingSearches.Remove(name, out var tcs)) |
|
|
|
{ |
|
|
|
_pendingSearches.Remove(name); |
|
|
|
tcs.SetResult(element); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -173,9 +173,8 @@ internal partial class MediaContext : ICompositorScheduler |
|
|
|
|
|
|
|
public void RemoveTopLevel(object key) |
|
|
|
{ |
|
|
|
if (_topLevels.TryGetValue(key, out var info)) |
|
|
|
if (_topLevels.Remove(key, out var info)) |
|
|
|
{ |
|
|
|
_topLevels.Remove(key); |
|
|
|
info.Renderer.Stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -292,9 +292,8 @@ internal struct InlineDictionary<TKey, TValue> : IEnumerable<KeyValuePair<TKey, |
|
|
|
} |
|
|
|
else if (_data is Dictionary<TKey, TValue?> dic) |
|
|
|
{ |
|
|
|
if (!dic.TryGetValue(key, out value)) |
|
|
|
if (!dic.Remove(key, out value)) |
|
|
|
return false; |
|
|
|
dic.Remove(key); |
|
|
|
} |
|
|
|
|
|
|
|
value = default; |
|
|
|
|