oday
04/19/2019, 4:36 PMsnowe
04/19/2019, 4:39 PModay
04/19/2019, 4:42 PMis_favorite == true on the items in list B that exist in List Asnowe
04/19/2019, 4:43 PModay
04/19/2019, 4:44 PMfor (snowe
04/19/2019, 4:46 PModay
04/19/2019, 4:46 PModay
04/19/2019, 4:46 PMsnowe
04/19/2019, 4:48 PMsnowe
04/19/2019, 4:48 PM.aggregatesnowe
04/19/2019, 4:48 PMA list and then aggregate to a B listsnowe
04/19/2019, 4:50 PMassociateWithsnowe
04/19/2019, 4:50 PModay
04/19/2019, 4:55 PMsearchResult.results.filter { carToMap ->
carToMap.id == favoritesSearchResult.results.find { it.id == carToMap.id }?.id
}.map { it.is_favorite = true }snowe
04/19/2019, 8:53 PMsnowe
04/19/2019, 8:53 PMilya.gorbunov
04/19/2019, 11:20 PMcontains of that set:
val favoriteIds = favoritesSearchResult.results.map { it.id }.toSet()
searchResult.results.forEach {
it.is_favorite = it.id in favoriteIds
}oday
04/20/2019, 9:42 AModay
04/20/2019, 9:42 AM