Skip to content

Conversation

@yavanosta
Copy link
Contributor

Seems that tm variable is redundant, because textModel is already read above. I don't see anything that can change it before it is reloaded, am I missing something?

If not, I think it worth it to remove redeclaration to simplify code.

Copilot AI review requested due to automatic review settings December 5, 2025 12:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes redundant code by eliminating an unnecessary re-read and null-check of the text model. The textModel variable is already declared and validated at the beginning of the _uiState derived callback (line 309-310), and nothing between that check and its later usage could invalidate it. The removed code (re-reading this._editorObs.model.read(reader) as tm) was functionally identical but added unnecessary complexity.

  • Removes redundant re-declaration and null-check of textModel variable

@benibenj benibenj merged commit 839fd2f into microsoft:main Dec 15, 2025
22 of 23 checks passed
@yavanosta yavanosta deleted the InlineEditsView-remove-extra-variable branch December 15, 2025 17:34
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.

5 participants