Skip to content

Commit 831ba98

Browse files
committed
Minor
1 parent 55d20e4 commit 831ba98

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

JL.Windows/GUI/PreferencesWindow.xaml.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,13 @@ private static async Task GetFields(ComboBox modelNamesComboBox, Panel miningPan
344344
string modelName = modelNamesComboBox.SelectionBoxItem.ToString()!;
345345

346346
List<string>? fieldNames = await AnkiUtils.GetFieldNames(modelName).ConfigureAwait(true);
347-
348347
if (fieldNames is not null)
349348
{
350-
Dictionary<string, JLField> fields =
351-
fieldNames.ToDictionary(static fieldName => fieldName, static _ => JLField.Nothing, StringComparer.Ordinal);
349+
Dictionary<string, JLField> fields = new(fieldNames.Count, StringComparer.Ordinal);
350+
for (int i = 0; i < fieldNames.Count; i++)
351+
{
352+
fields.Add(fieldNames[i], JLField.Nothing);
353+
}
352354

353355
CreateFieldElements(fields, fieldList, miningPanel);
354356
}

0 commit comments

Comments
 (0)