Skip to content

Conversation

@mbn-code
Copy link
Contributor

This pull request includes several changes to the projectCommand function in the src/commands/project_cmd.cpp file to improve its functionality and readability. The most important changes include fixing the index initialization, ensuring the index resets when it exceeds the number of projects, and moving the index increment to the end of the function.

Improvements to index handling:

  • src/commands/project_cmd.cpp: Changed the initialization of the index variable from -1 to 0 to avoid starting with an invalid index.
  • src/commands/project_cmd.cpp: Added a check to reset the index to 0 if it exceeds the number of projects, ensuring that the index stays within bounds.
  • src/commands/project_cmd.cpp: Moved the increment of the index variable to the end of the function to ensure it is incremented only after a project is successfully processed.

Copy link
Contributor

@ebcq ebcq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks!

@ebcq ebcq merged commit 0d63a4b into cppdiscord:main Feb 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants