Skip to content

refactor: cleanup code#945

Merged
Disservin merged 3 commits intomasterfrom
code-cleanup
Nov 21, 2025
Merged

refactor: cleanup code#945
Disservin merged 3 commits intomasterfrom
code-cleanup

Conversation

@Disservin
Copy link
Copy Markdown
Owner

  • increase some datatypes from int to int64_t
  • less nesting
  • more readable MoveData
  • assert

Copy link
Copy Markdown

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 PR refactors code for better readability and type safety by: (1) upgrading several integer types to int64_t to prevent overflow issues with large values like search depth, nodes, and scores; (2) removing the MoveData constructor in favor of default member initialization and explicit field assignment for clarity; and (3) reducing nested conditionals through early returns and inverted logic.

  • Upgraded data types from int to int64_t for depth, seldepth, score, and hashfull fields
  • Refactored MoveData from constructor-based to field-assignment initialization
  • Reduced nesting by inverting conditionals and using early returns in multiple functions

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/types/match_data.hpp Removed MoveData constructor, changed int fields to int64_t, reordered members, updated MatchData constructor parameter to string_view
app/src/matchmaking/match/match.cpp Replaced MoveData constructor calls with field assignment, updated findElement template parameter types, reduced nesting in verifyPvLines, added assert in convertChessReason
app/src/engine/uci_engine.hpp Reduced nesting in setAffinity by inverting success check and using early return
app/src/engine/uci_engine.cpp Updated findElement template parameters from int to int64_t, reduced nesting in lastScore
app/src/core/helper.hpp Added int64_t template specialization to findElement function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Disservin Disservin merged commit ba7805a into master Nov 21, 2025
18 checks passed
@Disservin Disservin deleted the code-cleanup branch November 21, 2025 18:35
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