Commit 19dc35a
committed
refactor: Improve list building and sorting logic
This commit refactors the list processing logic to improve its safety and efficiency.
The building of the visible list and the mapping of pinned statuses are now performed in a single loop. This avoids potential `IndexOutOfBoundsException` errors that could occur if the sizes of the item list and the pinned status map were mismatched. The sorting logic remains the same but now operates on this more safely constructed list. Additionally, a check to skip duplicate items has been added within the loop.1 parent ccafe0b commit 19dc35a
File tree
1 file changed
+13
-7
lines changed- app/src/main/java/com/github/droidworksstudio/mlauncher
1 file changed
+13
-7
lines changedLines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | | - | |
| 467 | + | |
467 | 468 | | |
468 | 469 | | |
| 470 | + | |
| 471 | + | |
469 | 472 | | |
| 473 | + | |
| 474 | + | |
470 | 475 | | |
471 | | - | |
472 | | - | |
473 | 476 | | |
474 | | - | |
475 | | - | |
476 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | 484 | | |
479 | | - | |
| 485 | + | |
480 | 486 | | |
481 | 487 | | |
482 | 488 | | |
| |||
0 commit comments