Skip to content

Commit 663ec0e

Browse files
SubhikshaSf4851jfversluis
authored andcommitted
Used FlyoutItems Count directly
1 parent c53dfc8 commit 663ec0e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Controls/src/Core/Handlers/Shell/Windows/ShellView.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ internal void UpdateMenuItemSource()
122122
{
123123
_flyoutGrouping = newGrouping;
124124
var newItems = IterateItems(newGrouping).ToList();
125-
var itemsCount = FlyoutItems.Count;
126125
var newItemsSet = new HashSet<object>(newItems);
127126
var flyoutItemsSet = new HashSet<object>(FlyoutItems);
128127

@@ -133,7 +132,7 @@ internal void UpdateMenuItemSource()
133132
if (!flyoutItemsSet.Contains(item))
134133
{
135134
// Use Insert when within bounds, otherwise Add
136-
if (index < itemsCount)
135+
if (index < FlyoutItems.Count)
137136
{
138137
FlyoutItems.Insert(index, item);
139138
}

0 commit comments

Comments
 (0)