S3949 for GetHashCode

Visual Studio 2019 can generate implementation for GetHashCode. For example the following:

        public override int GetHashCode()
        {
            int hashCode = -1205156623;
            hashCode = hashCode * -1521134295 + TotalAllocatedMemorySize.GetHashCode();
            hashCode = hashCode * -1521134295 + SurvivedMemorySize.GetHashCode();
            return hashCode;
        }

Overflowing calculations don’t matter here, as the actual value is not that relevant. I don’t expect S3949 to be raised for this code.

This issue was also reported and answered in our github repo

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.