Skip to content

Unused/obsolete code in XtermEngine #17280

@j4james

Description

@j4james

In the XtermEngine::StartPaint method, there's some code that calculates the dirty area here:

{
std::span<const til::rect> dirty;
RETURN_IF_FAILED(GetDirtyArea(dirty));
// If we have 0 or 1 dirty pieces in the area, set as appropriate.
auto dirtyView = dirty.empty() ? Viewport::Empty() : Viewport::FromExclusive(til::at(dirty, 0));
// If there's more than 1, union them all up with the 1 we already have.
for (size_t i = 1; i < dirty.size(); ++i)
{
dirtyView = Viewport::Union(dirtyView, Viewport::FromExclusive(til::at(dirty, i)));
}
}

However, the result of that calculation is not actually used. There was a time when there was more code in that branch that compared the dirty area against the last viewport, but that was removed in PR #4741.


And in the XtermEngine::_MoveCursor method there's a local variable performedSoftWrap which is initially set to false at the start of the method here:

auto performedSoftWrap = false;

And it's potentially changed to true later in the code:

if (previousLineWrapped)
{
performedSoftWrap = true;
_trace.TraceWrapped();
hr = S_OK;
}

However, the variable is otherwise never read. It looks like it was added as part of PR #5181, but even then it doesn't appear to have been used.

Unless there is something I'm missing, I'd suggest we should remove the unused code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions