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

Remove arguments overloading in SetDrawColor and SetTextColor #3157

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

Astralcircle
Copy link
Contributor

Micro-optimization

@@ -105,7 +105,7 @@ if CLIENT then
-- This is overridable by other wire entities which want to customize the overlay, but generally you shouldn't override it
function ENT:DrawWorldTipOutline( pos )
draw.NoTexture()
surface.SetDrawColor(Color(25,25,25,200))
surface.SetDrawColor(25, 25, 25, 200)
Copy link
Contributor

@deltamolfar deltamolfar Oct 25, 2024

Choose a reason for hiding this comment

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

Why that, instead of creating local color beforehand on outer scope, if color is static?

Copy link
Contributor Author

@Astralcircle Astralcircle Oct 25, 2024

Choose a reason for hiding this comment

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

There is no difference, and we also save a bit of code performance because we don't call __index method.
Also check this

Copy link
Contributor

Choose a reason for hiding this comment

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

Well that's interesting. Thanks for sharing :)

@Denneisk
Copy link
Member

Garry adding the most unappreciated class ever.

@thegrb93 thegrb93 merged commit 87e6ca0 into wiremod:master Oct 25, 2024
1 check failed
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.

4 participants