Repository: dotnet/runtime
File: src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/WindowsNodeMangler.cs (C#)

Code before:

        public const string NonGCStaticMemberName = "__NONGCSTATICS";
        public const string GCStaticMemberName = "__GCSTATICS";
        public const string ThreadStaticMemberName = "__THREADSTATICS";
        public const string ThreadStaticIndexName = "__THREADSTATICINDEX";

        public WindowsNodeMangler(TargetDetails target)
        {
            _target = target;
        }

        // Mangled name of boxed version of a type
        public sealed override string MangledBoxedTypeName(TypeDesc type)
        {
            Debug.Assert(type.IsValueType);
            return "Boxed_" + NameMangler.GetMangledTypeName(type);
        }

        public sealed override string MethodTable(TypeDesc type)
        {
            string mangledJustTypeName;

            if (type.IsValueType)
                mangledJustTypeName = MangledBoxedTypeName(type);
            else
                mangledJustTypeName = NameMangler.GetMangledTypeName(type).ToString();

            // "??_7TypeName@@6B@" is the C++ mangling for "const TypeName::`vftable'"
            // This, along with LF_VTSHAPE debug records added by the object writer
            // is the debugger magic that allows debuggers to vcast types to their bases.
            return "??_7" + mangledJustTypeName + "@@6B@";
        }

        private string CreateStaticFieldName(TypeDesc type, string fieldName)
        {
            return @$"?{fieldName}@{NameMangler.GetMangledTypeName(type)}@@";
        }

        public sealed override string GCStatics(TypeDesc type)
        {
            return CreateStaticFieldName(type, GCStaticMemberName);
        }

        public sealed override string NonGCStatics(TypeDesc type)
        {
            return CreateStaticFieldName(type, NonGCStaticMemberName);
        }

        public sealed override string ThreadStatics(TypeDesc type)
        {
            return CreateStaticFieldName(type, NameMangler.CompilationUnitPrefix + ThreadStaticMemberName);

Review comment (suggestion):
```suggestion
string mangledJustTypeName = type.IsValueType
    ? MangledBoxedTypeName(type)
    : NameMangler.GetMangledTypeName(type).ToString()
```

Code after:

        public const string NonGCStaticMemberName = "__NONGCSTATICS";
        public const string GCStaticMemberName = "__GCSTATICS";
        public const string ThreadStaticMemberName = "__THREADSTATICS";
        public const string ThreadStaticIndexName = "__THREADSTATICINDEX";

        public WindowsNodeMangler(TargetDetails target)
        {
            _target = target;
        }

        // Mangled name of boxed version of a type
        public sealed override string MangledBoxedTypeName(TypeDesc type)
        {
            Debug.Assert(type.IsValueType);
            return "Boxed_" + NameMangler.GetMangledTypeName(type);
        }

        public sealed override string MethodTable(TypeDesc type)
        {
            string mangledJustTypeName = type.IsValueType
                ? MangledBoxedTypeName(type)
                : NameMangler.GetMangledTypeName(type).ToString();

            // "??_7TypeName@@6B@" is the C++ mangling for "const TypeName::`vftable'"
            // This, along with LF_VTSHAPE debug records added by the object writer
            // is the debugger magic that allows debuggers to vcast types to their bases.
            return "??_7" + mangledJustTypeName + "@@6B@";
        }

        private string CreateStaticFieldName(TypeDesc type, string fieldName)
        {
            return @$"?{fieldName}@{NameMangler.GetMangledTypeName(type)}@@";
        }

        public sealed override string GCStatics(TypeDesc type)
        {
            return CreateStaticFieldName(type, GCStaticMemberName);
        }

        public sealed override string NonGCStatics(TypeDesc type)
        {
            return CreateStaticFieldName(type, NonGCStaticMemberName);
        }

        public sealed override string ThreadStatics(TypeDesc type)
        {
            return CreateStaticFieldName(type, NameMangler.CompilationUnitPrefix + ThreadStaticMemberName);
        }

        public sealed override string ThreadStaticsIndex(TypeDesc type)