-
Notifications
You must be signed in to change notification settings - Fork 79
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
T-Buttons: small efficiency boost #1006
Conversation
changed the chained if-elseif to table lookup due to integers being used and not strings for the index/conditional check im still new to lua so feel free to roast me, im tryna learn, coming from java
i just realized i left the recv variable outside the if-block that uses it............. :\ also idk how/if garbage collection works in lua, but i shouldve set recv to nil afterwards to save memory (maybe?) |
i just realized the first If true = do a bunch of stuff should be if false = return... |
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.
All in all i like this change. Imo it makes the code more readable by using a lookup table and the ternary operator.
In regards to the code comments: I personally would remove them, as they don't really add more to what the code itself already tells us.
Regarding requested changes, please do address your own comments on this pull request, they are definitely valid :)
i dont think RECEIVE_ALL is gonna have a fun time. It probably is going to fail to get called... but according to something i read off google: Nil isnt actually nothing, it's just an absolutely unique property value so this should be fine. Coinflippin it
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.
I like this, thanks a lot. But please address the points raised by @Histalek
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
sorry, i had a bunch of things taking up my time and energy |
No worries! (i probably need to reconfigure the stale bot to only annoy us Team-Members or remove it altogether ...) |
tried to make it more legible and efficient
so i made it more complicated =)