-
Notifications
You must be signed in to change notification settings - Fork 812
Improving the problems menu #2261
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
base: master
Are you sure you want to change the base?
Conversation
Let me briefly explain my optimization 🙃 Both algorithms (the existing one and mine) have the same O(n log n) complexity, but my version has fewer operations and a better constant factor. At low error counts, the difference is negligible, but at scale, mine will be faster. I also use an array instead of a hash table, which is more efficient, and perform fewer sorting passes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please actually test your changes before making a Pull Request. How many times do I have to encounter PRs that do not work?
I made the problem menu close on ESP only in the main menu. I also rolled back the changes related to the list refresh processing function. The mistake was that I carelessly passed the table that I made a copy of in the argument and cleaned it up locally. I decided to return the old version |
cls_background.mp4 |
You should not be removing the default close button. |
All done |
ReceivedError()
function by implementing a single-pass array sorting with numeric indices instead of multiple iterations. This optimization reduces memory allocations and improves efficiency when handling large numbers of error panelsinput.IsKeyDown()
in theThink()
method since the standard OnKeyCodePressed handler doesn't capture the ESCAPE key in Garry's Mod menu system). This improves UX by allowing users to close the menu using the standard game key