Allow circuits to "Save As" their editor name#16
Allow circuits to "Save As" their editor name#16AmityWilder wants to merge 1 commit intobsiever:masterfrom
Conversation
| if (edit == this) | ||
| continue; |
There was a problem hiding this comment.
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.
Fixes #15