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

Refactor Windows Utilities & Improve Brotli Performance #6

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

darkstorm2150
Copy link
Contributor

@darkstorm2150 darkstorm2150 commented Oct 16, 2024

This pull request includes two commits that enhance the codebase in different areas:

1. Refactor Windows Utilities: Enhanced Security & Code Readability

  • Improved token handling in RunningAsAdminPROCESSES for secure Administrator privilege checks.
  • Removed unused GenerateCtrlCPROCESSES function to prevent potential security vulnerabilities.
  • Added clear, concise comments for each function to facilitate understanding.
  • Reformatted code for consistent spacing and indentation.

2. Improve Brotli Performance

  • Replaced magic numbers with predefined Brotli constants, enhancing code readability and maintainability.
  • Improved performance by reusing a buffer, reducing memory allocations.

Affected Files:

  • Utils/windows_utilities.go (refactored)
  • Utils/UtilsDeCompression.go (performance improvements)

@darkstorm2150 darkstorm2150 changed the title Replaced numbers with predefined Brotli constants, reused buffer. Refactor Windows Utilities & Improve Brotli Performance Oct 16, 2024
* Checks if the program is running with Administrator (root) privileges.
*
* @return true if running as admin, false otherwise
*/
Copy link
Owner

Choose a reason for hiding this comment

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

Just a thing. Could you leave it with the documentation "format" I had? And on line 84+ too? I have it like that on purpose. If you click Ctrl+Q on GoLand with the cursor on the documentation, the documentation appears properly formatted. First I had as you put, but I noticed GoLand doesn't properly format it, so I changed the format to the one I use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand, I will make changes needed.

@Edw590 Edw590 merged commit 2420ec5 into Edw590:main Oct 17, 2024
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