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.
About the pull request
Replaces
list.len
lookup withlength(list)
.The following replacements are broadly applied:
list.len
->length(list)
: except wherelen is being assigned or modified, such as
list.len--`, which is a valid use-caselist && list.len
,!isnull(list) && list.len
,list?.len
->LAZYLEN(list)
: also the inverted form;LAZYLEN
is just a define forlength
but is used here to more clearly communicate that originally the list was tested for existenceif(list.len) list.Cut()
->LAZYCLEARLIST(list)
: identical to the define so instead of replacinglen
withlength
just used the defineA few one-offs:
(list?(list.len):(0))
->(LAZYLEN(list) || 0)
inrecipe.dm
: resulting value gets assigned to a variable that is used elsewhere, so ensured it returned 0 in the same circumstancesif(!list || !list.len) { return FALSE } if(list?.len) { ...
->if(!LAZYLEN(list)) { return FALSE } ...
inmodify_variables.dm
: simplified two branching checks into one!list || list.len == 0
->!LAZYLEN(list)
inteleporter.dm
: removed the==
test to allow simplifying down toLAZYLEN
while ensuring it has the same truthinessExplain why it's good for the game
length(list)
is preferred overlist.len
since it inherently handles nulls and is allegedly slightly more performant.Testing Photographs and Procedure
Boots without issue.
Changelog
No player-facing changes.