Skip to content

Allow circuits to "Save As" their editor name#16

Open
AmityWilder wants to merge 1 commit intobsiever:masterfrom
AmityWilder:save-as-current
Open

Allow circuits to "Save As" their editor name#16
AmityWilder wants to merge 1 commit intobsiever:masterfrom
AmityWilder:save-as-current

Conversation

@AmityWilder
Copy link

Fixes #15

Comment on lines +163 to +164
if (edit == this)
continue;
Copy link
Author

@AmityWilder AmityWilder Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the edit == this check as close to last as reasonable, since it would only be true for one editor. If it was the first check, then every editor would have to execute this test despite only one of them possibly getting skipped because of it.

Having it later means that the broader checks will have already filtered out a majority of the editors. Thus, this narrow (albeit cheap) check will only be applied to a number of editors much closer to the number of editors it could yield true for (1).

The reason it isn't after the name.equals(...) check despite that one being even broader is because, assuming Java treats ... == this the way C++ does, edit == this would be a hardware-supported 8 byte pointer equality test; much cheaper than a software-supported arbitrary-length-string equality test.

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.

Save As current editor name

1 participant