Skip to content

Commit

Permalink
update PropertyRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Jan 19, 2024
1 parent 89360e8 commit 1bbbb34
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/Beutl.Core/PropertyRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,17 @@ public static void Register(Type type, CoreProperty property)
if (!s_registered.TryGetValue(type, out Dictionary<int, CoreProperty>? inner))
{
inner = new Dictionary<int, CoreProperty>
{
{ property.Id, property },
};
{
{ property.Id, property },
};
s_registered.Add(type, inner);
}
else if (!inner.ContainsKey(property.Id))
else
{
inner.Add(property.Id, property);
inner.TryAdd(property.Id, property);
}

if (!s_properties.ContainsKey(property.Id))
{
s_properties.Add(property.Id, property);
}
s_properties.TryAdd(property.Id, property);

s_registeredCache.Clear();
}
Expand Down

0 comments on commit 1bbbb34

Please sign in to comment.