Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split matchmaker.Process into smaller functions for readability #943

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

redbaron
Copy link
Contributor

@redbaron redbaron commented Nov 7, 2022

matchmaker.Process was one big hard to follow function. This PR attempts to extract isolated pieces of logic into own function.

It is probably best to review on commit by commit basis, rather than in PR diff interface.

All commits except last two are either trivial changes or result of IDE's refactor tool, so very mechanical in essence and chance of introducing bugs is minimal. Only manual input required in these refactors was to bubble up break/continue control statements from within function via bool return param.

Last two commits are more substantial:

  • ccf77ab (and preceeding 8de9f0f): unifies conflict check between indexes. We have 3 conflicts checks: hit -> current index, each combo entry -> hit and hit -> each combo entry. All three are now done with the same function accepting 2 indexes and a boolean flag to check whether reverse conflict check is required.

  • 19b9ecf : atomic unit of matchmaking is matchmaking index, but MM logic used to operate on entries, which required converting to index in multiple places. This commits makes MM loop to operate on indexes, producing final entries only at the very end.

@redbaron redbaron requested a review from zyro November 7, 2022 11:53
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.

None yet

1 participant