Skip to content

Conversation

@LuizMacedo
Copy link
Contributor

This pull request refactors the logic for grouping and displaying exercises by topic in the index.md file. The changes improve clarity and maintainability by introducing a new sorted_groups variable to handle the ordering of grouped exercises.

Refactoring of exercise grouping logic:

  • Updated the topic_order variable to use capitalized topic names ("Basic,Intermediate,Advanced,Expert") for consistency.
  • Introduced a sorted_groups variable to store pre-sorted groups, replacing the inline filtering and sorting logic in multiple loops. This simplifies the code and avoids redundant operations.
  • Adjusted the loops to iterate over sorted_groups instead of dynamically filtering grouped_exercises during each iteration.
  • Removed unused or redundant conditional checks and lines for improved readability.

@LuizMacedo LuizMacedo requested a review from Copilot July 25, 2025 05:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the exercise grouping and sorting logic in index.md to improve code clarity and maintainability. The changes eliminate redundant filtering operations and introduce a more structured approach to handling sorted exercise groups.

  • Standardized topic naming by capitalizing topic names in topic_order
  • Introduced sorted_groups variable to pre-sort groups once instead of filtering repeatedly
  • Simplified loop logic by removing redundant conditional checks and inline filtering

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@LuizMacedo LuizMacedo merged commit 3e33a2c into main Jul 25, 2025
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