Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not trigger unnecessary environment changes #11819

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

DonJayamanne
Copy link
Contributor

}
if (changed) {
this.didChangeInterpreters.fire();
if (triggerChangeEvent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this still also check changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like we're now just firing this event for every interpreter found

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need, if you check the code, previously changed was initialize din line 498, all i've done is moved this code into the same if block, which was effectively the same, & there by removing the unnecessary variable as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I.e. it will not fire everytime, only when there are changes (where previously we'd set changed = true in the same if condition

@DonJayamanne DonJayamanne merged commit 9307d25 into main Oct 26, 2022
@DonJayamanne DonJayamanne deleted the doNotTriggerUnnecessaryChanges branch October 26, 2022 22:31
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.

2 participants