Clean-up in game.macro#8723
Merged
Merged
Conversation
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.
Three pieces of clean-up, in response to the recent reworks:
The new handling of binds means that it is always a vector. There was still a check if it was not and handling for that case, that has been removed.
I broke the definition of binds into two steps. Checking if we need to supply a default and spitting it it off from action are now done in the first step and the nesting of the provided bind into the deeper binding. This removed some repeated code and I believe it is clearer to read.
There was a bunch of extra code in emit-only. Did a few passes over it taking advantage of the function in mapcat, that nil is the same as an empty sequence and concatenates to nothing and that missing bindings are false to get it down to a single line. (That last one is a change of behaviour if a false value is ever in the map, but I don't see that ever happening.