Skip to content

Commit 917c62a

Browse files
Small Optimization
1 parent baa7caa commit 917c62a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Files.App/Views/SettingsPages/Advanced.xaml.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public sealed partial class Advanced : Page
1818

1919
private string oldTagName = string.Empty;
2020

21-
private int nextRenameIndex = 0;
22-
2321
private TagViewModel? renamingTag;
2422

2523
private TagViewModel? preRenamingTag;
@@ -84,10 +82,7 @@ private void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
8482
textBox.LostFocus -= RenameTextBox_LostFocus;
8583

8684
var isShiftPressed = (GetKeyState((int)VirtualKey.Shift) & KEY_DOWN_MASK) != 0;
87-
nextRenameIndex = isShiftPressed ? -1 : 1;
88-
89-
var newIndex = TagsList.SelectedIndex + nextRenameIndex;
90-
nextRenameIndex = 0;
85+
var newIndex = TagsList.SelectedIndex + (isShiftPressed ? -1 : 1);
9186

9287
if (textBox.Text != oldTagName)
9388
CommitRename(textBox);

0 commit comments

Comments
 (0)