Skip to content

Commit

Permalink
fix CA1864
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Apr 27, 2024
1 parent 48d5ebf commit 3438dc3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ public override int GetItemViewType(int position)
var id = template?.Id ?? ItemViewType.TemplatedItem;

// Cache the data template for future use
if (!_viewTypeDataTemplates.ContainsKey(id))
_viewTypeDataTemplates.Add(id, template);

_viewTypeDataTemplates.TryAdd(id, template);
return id;
}

Expand Down
1 change: 1 addition & 0 deletions src/Core/src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ dotnet_diagnostic.CA1846.severity = error
dotnet_diagnostic.CA1847.severity = error
dotnet_diagnostic.CA1859.severity = error
dotnet_diagnostic.CA1860.severity = error
dotnet_diagnostic.CA1864.severity = error
dotnet_diagnostic.CA1865.severity = error
dotnet_diagnostic.CA2249.severity = error
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ public void AddScrollableElementHandler(IScrollView scrollBar)

if (nativeScroll != null && nativeScroll is ScrollViewer viewer)
{
if (!_scrollViews.ContainsKey(scrollBar))
if (_scrollViews.TryAdd(scrollBar, viewer))
{
_scrollViews.Add(scrollBar, viewer);
viewer.ViewChanging += OnViewChanging;
}
}
Expand Down

0 comments on commit 3438dc3

Please sign in to comment.