Improve: [Refactor] remove unneeded (and dangerously named) local variable#5464
Merged
SlySven merged 2 commits intoMudlet:developmentfrom Oct 9, 2021
Conversation
It turns out that the variable concerned, `__Pick` is a very badly named (as symbols containing a double underscore or an underscore and followed by an upper-case letter are explicitly reserved, e.g. see: https://stackoverflow.com/a/1449301/4805858 ) Fortunately, it isn't needed and there is no need to pass the class member it is a copy of via the `drawRoom(...)` method in the `T2DMap` class as that can use the class value directly quite safely - as it never modifies it. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Member
|
This PR needs to be updated with latest |
Member
Author
Well it doesn't touch anything Lua - but i can see that that one check has stalled on it - so let me just pull in those changes... |
…NamedLocalVariable Needed to pull in development branch changes that include a Lua testing framework. Signed-off by: Stephen Lyons <slysven@virginmedia.com>
vadi2
approved these changes
Oct 9, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
It turns out that the variable concerned,
__Pickis very badly named (as symbols containing a double underscore or an underscore and followed by an upper-case letter are explicitly reserved, e.g. see: https://stackoverflow.com/a/1449301/4805858 )Fortunately, it isn't needed and there is no need to pass the class member it copies via an argument to the
drawRoom(...)method in theT2DMapclass as that can use the class value directly quite safely - as it never modifies it.Motivation for adding to Mudlet
I came across this as I was starting to look at cleaning up the 2D Mapper code to see if I could make some changes to improve the map label code - I was just reviewing all the
boolflags in theT2DMapthat effectively form various state machines for different operations...Signed-off-by: Stephen Lyons slysven@virginmedia.com