-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# About the pull request Replaces `list.len` lookup with `length(list)`. The following replacements are broadly applied: - `list.len` -> `length(list)` : except where `len is being assigned or modified, such as `list.len--`, which is a valid use-case - `list && list.len`, `!isnull(list) && list.len`, `list?.len` -> `LAZYLEN(list)` : also the inverted form; `LAZYLEN` is just a define for `length` but is used here to more clearly communicate that originally the list was tested for existence - `if(list.len) list.Cut()` -> `LAZYCLEARLIST(list)` : identical to the define so instead of replacing `len` with `length` just used the define A few one-offs: - `(list?(list.len):(0))` -> `(LAZYLEN(list) || 0)` in `recipe.dm` : resulting value gets assigned to a variable that is used elsewhere, so ensured it returned 0 in the same circumstances - `if(!list || !list.len) { return FALSE } if(list?.len) { ...`-> `if(!LAZYLEN(list)) { return FALSE } ...` in `modify_variables.dm` : simplified two branching checks into one - `!list || list.len == 0` -> `!LAZYLEN(list)` in `teleporter.dm` : removed the `==` test to allow simplifying down to `LAZYLEN` while ensuring it has the same truthiness <!-- Remove this text and explain what the purpose of your PR is. Mention if you have tested your changes. If you changed a map, make sure you used the mapmerge tool. If this is an Issue Correction, you can type "Fixes Issue #169420" to link the PR to the corresponding Issue number #169420. Remember: something that is self-evident to you might not be to others. Explain your rationale fully, even if you feel it goes without saying. --> # Explain why it's good for the game `length(list)` is preferred over `list.len` since it inherently handles nulls and is allegedly slightly more performant. # Testing Photographs and Procedure Boots without issue. # Changelog No player-facing changes.
- Loading branch information
Showing
381 changed files
with
1,252 additions
and
1,261 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.