Skip to content

Potential Redundancy: currentDessertIndex Appears Unnecessary for App Functionality #53

@deshkaustubh

Description

@deshkaustubh

While reviewing and referencing the codebase, I noticed that the variable currentDessertIndex (located at DessertViewModel.kt:21) doesn't seem necessary for the app's current functionality.

The app runs smoothly without it if the initial values of dessertImageId, dessertPrice, and dessertStartProductionAmount are set from the first item of the desserts list during initialization.

This simplification could improve readability and reduce the dependency on redundant state.

Enhancements:

  1. Remove currentDessertIndex
  2. Directly initialize required values from desserts[0]
  3. Monitor any regression during dessert upgrades

Let me know if you'd like me to provide a PR for this. Thanks for the awesome learning resource!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions