loop8ack / ExtensionPackTools

Import and export lists of Visual Studio extensions.
Other
78 stars 15 forks source link

Code of the Extension.Equals method can be simplified #53

Closed astrohart closed 2 years ago

astrohart commented 2 years ago

In the file Extension.cs that lives in the Models folder of the ExtensionManager.Shared project, the Extension.Equals method's code can be simplified. Listing 1 shows the code as it is now. Listing 2 shows the proposed, simplified version.

public override bool Equals(object obj)
{
    return !(obj is Extension other) ? false : ID == other.ID;
}

Listing 1. Current code for the Extension.Equals method.

public override bool Equals(object obj)
{
    return obj is Extension other && ID == other.ID;
}

Listing 2. Simplified version.

astrohart commented 2 years ago

Please see PR #54.