Optimize unnecessary copy

This commit is contained in:
Ming Ming 2021-11-22 16:35:32 +08:00
parent 0de7e5ed87
commit f9ae813613

View file

@ -191,7 +191,7 @@ class ListSharingBloc extends Bloc<ListSharingBlocEvent, ListSharingBlocState> {
if (state is! ListSharingBlocSuccess && state is! ListSharingBlocFailure) { if (state is! ListSharingBlocSuccess && state is! ListSharingBlocFailure) {
return; return;
} }
final newItems = List.of(state.items) final newItems = state.items
.where((element) => !ev.shares.containsIdentical(element.share)) .where((element) => !ev.shares.containsIdentical(element.share))
.toList(); .toList();
// i love hacks :) // i love hacks :)