Skip to content

Conversation

@zedlopez
Copy link
Contributor

Changes

'now all things enclosed by the player are unmarked for listing;`

to

'now all things are unmarked for listing;`

@Mydnyteraven
Copy link

Does this not.. increase the scope to things which aren't held?

You guys are the experts, this just seems to be highly unspecific

@zedlopez
Copy link
Contributor Author

If you look at the whole rule, you'll see that the following (unchanged) line is to set marked-for-listing on all held things. In general, operations that care about marked-for-listing start with unsetting marked-for-listing everywhere. And in particular, preserving the prior marked-for-listing-ness of unenclosed things isn't relevant here. So testing each thing for enclosure just burns cycles to no end.

(Also, this change doesn't alter the output of Inform's whole test suite.)

@erkyrath
Copy link
Collaborator

We should note that for some constructions, Inform compiles a more efficient objectloop (x in player) and therefore avoids looping through the entire object list. However, this statement doesn't do that. (Because "enclosure" is a recursive concept, not a simple object-tree list.) So there's no hidden cost to this change.

(Arguably Inform should compile "all things enclosed by the player..." as a recursive objectloop call. That would be more efficient in a large game. But it does not currently work this way!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants