Skip to content

Commit

Permalink
Reduce one level of nesting (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvanpoppel committed May 17, 2020
1 parent 28a45d7 commit 890e8a3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions KeeTrayTOTP/FormSettings.cs
@@ -1,6 +1,7 @@
using KeePass.UI;
using System;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;

namespace KeeTrayTOTP
Expand Down Expand Up @@ -315,15 +316,12 @@ private void WorkerLoad_DoWork(object sender, DoWorkEventArgs e)
// Storage
if (_plugin.PluginHost.MainWindow.ActiveDatabase.IsOpen)
{
foreach (var pe in _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.GetEntries(true))
foreach (var str in _plugin.PluginHost.MainWindow.ActiveDatabase.RootGroup.GetEntries(true).SelectMany(pe => pe.Strings))
{
foreach (var str in pe.Strings)
if (!ComboBoxTOTPSeedStringName.Items.Contains(str.Key))
{
if (!ComboBoxTOTPSeedStringName.Items.Contains(str.Key))
{
ComboBoxTOTPSeedStringName.Items.Add(str.Key);
ComboBoxTOTPSettingsStringName.Items.Add(str.Key);
}
ComboBoxTOTPSeedStringName.Items.Add(str.Key);
ComboBoxTOTPSettingsStringName.Items.Add(str.Key);
}
}
}
Expand Down

0 comments on commit 890e8a3

Please sign in to comment.