Duplicate code in TermControl.cpp #15654

Open
opened 2026-01-31 04:44:39 +00:00 by claunia · 0 comments
Owner

Originally created by @serd2011 on GitHub (Oct 22, 2021).

Originally assigned to: @zadjii-msft on GitHub.

While reading code in TermControl.cpp i stumble upon two lines of code that are absolutely the same and are called one after another.
670ae2bd1c/src/cascadia/TerminalControl/TermControl.cpp (L333-L334)
670ae2bd1c/src/cascadia/TerminalControl/TermControl.cpp (L380-L381)

They are both called from TermControl::UpdateSettings()
_UpdateSettingsFromUIThread -> _ApplyUISettings and _UpdateAppearanceFromUIThread

Not sure if this is because of the situations in which this functions might be called separately but this just looks weird

Originally created by @serd2011 on GitHub (Oct 22, 2021). Originally assigned to: @zadjii-msft on GitHub. While reading code in [TermControl.cpp](https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalControl/TermControl.cpp) i stumble upon two lines of code that are absolutely the same and are called one after another. https://github.com/microsoft/terminal/blob/670ae2bd1c78fd2cc5b8e88f426eacab71fe1bfb/src/cascadia/TerminalControl/TermControl.cpp#L333-L334 https://github.com/microsoft/terminal/blob/670ae2bd1c78fd2cc5b8e88f426eacab71fe1bfb/src/cascadia/TerminalControl/TermControl.cpp#L380-L381 They are both called from ```TermControl::UpdateSettings()``` ```_UpdateSettingsFromUIThread``` -> ```_ApplyUISettings``` and ```_UpdateAppearanceFromUIThread``` Not sure if this is because of the situations in which this functions might be called separately but this just looks weird
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15654