Don't call concat for every book.

This commit is contained in:
Michael Bucari-Tovo 2022-05-16 12:10:54 -06:00
parent 7b8a4e4d72
commit c28872544c

View File

@ -190,10 +190,12 @@ namespace LibationWinForms
string existingFilter = gridEntryBindingSource.Filter; string existingFilter = gridEntryBindingSource.Filter;
//Add absent books to grid, or update current books //Add absent books to grid, or update current books
var allItmes = bindingList.AllItems;
for (var i = dbBooks.Count - 1; i >= 0; i--) for (var i = dbBooks.Count - 1; i >= 0; i--)
{ {
var libraryBook = dbBooks[i]; var libraryBook = dbBooks[i];
var existingItem = bindingList.AllItems.FirstOrDefault(i => i.AudibleProductId == libraryBook.Book.AudibleProductId); var existingItem = allItmes.FirstOrDefault(i => i.AudibleProductId == libraryBook.Book.AudibleProductId);
// add new to top // add new to top
if (existingItem is null) if (existingItem is null)