Skip to content

Only iterate panes one time when updating settings - #10997

Merged
4 commits merged into
mainfrom
dev/duhowett/fix-profile-reload-iteration
Aug 23, 2021
Merged

4 commits merged into
mainfrom
dev/duhowett/fix-profile-reload-iteration

Conversation

@DHowett

@DHowett Dustin L. Howett (DHowett) commented Aug 20, 2021 •

Copy link
Copy Markdown
Member

The original code for settings reload iterated the entire tree of panes
for every profile in the new settings (O(mn)) and constructed a
TerminalSettings object for every profile even if it later went unused.

This implementation:

  1. Collects all new profiles keyed by guid
    1.a. Adds the "defaults" profile to the map
  2. Iterates every pane, just once, and updates its profile if it shows
    up in the list by GUID.

I've merged all of the per-tab code into a single loop.

Because of 1.a., this code can now update panes that are hosting the
"base" profile.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

love it

Comment thread src/cascadia/TerminalApp/Pane.h Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
Base automatically changed from dev/duhowett/no-profile-guid to main August 23, 2021 17:11
The original code for settings reload iterated the entire tree of panes
for every profile in the new settings, and constructed a
TerminalSettings object for every profile even if it later went unused.

This implementation:

1. Collects all new profiles keyed by guid
1.a. Adds the "defaults" profile to the map
2. Iterates every pane, just once, and updates its profile if it shows
   up in the list by GUID.

I've merged all of the per-tab code into a single loop.

Because of 1.a., this code can now update panes that are hosting the
"base" profile.

@lhecker Leonard Hecker (lhecker) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a nit. Not approving just so it doesn't automerge accidentally.

@DHowett

Copy link
Copy Markdown
Member Author

@msftbot make sure Mike Griese (@zadjii-msft) signs off

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 23, 2021
@ghost

Copy link
Copy Markdown

Hello Dustin L. Howett (@DHowett)!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost
ghost merged commit 10992b7 into main Aug 23, 2021
@ghost
ghost deleted the dev/duhowett/fix-profile-reload-iteration branch August 23, 2021 19:20
@ghost

Copy link
Copy Markdown

🎉Windows Terminal Preview v1.11.2421.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AutoMerge Marked for automatic merge by the bot when requirements are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants