mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-05-22 23:12:16 +00:00
reduce memory usage
`chapters.length - chapters.reversed.toList().indexOf(chapters.reversed.toList()[finalIndex]) - 1;` is just the same as `chapters.length - 1 - finalIndex` but it creates two lists, which is wasteful.
This commit is contained in:
parent
0a2c8e2649
commit
8adb8bee17
1 changed files with 1 additions and 7 deletions
|
|
@ -900,14 +900,8 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
|
|||
chapterLength: chapters.length,
|
||||
);
|
||||
}
|
||||
int reverseIndex =
|
||||
chapters.length -
|
||||
chapters.reversed.toList().indexOf(
|
||||
chapters.reversed.toList()[finalIndex],
|
||||
) -
|
||||
1;
|
||||
final indexx = reverse
|
||||
? reverseIndex
|
||||
? (chapters.length - 1 - finalIndex)
|
||||
: finalIndex;
|
||||
return ChapterListTileWidget(
|
||||
chapter: chapters[indexx],
|
||||
|
|
|
|||
Loading…
Reference in a new issue