Closed citizenmatt closed 1 year ago
myPrimitive.ToString()
will still allocate a string
object, if it hasn't been interned, right? In any case, if modern compilers skip the boxing then the plugin's message at least is incorrect.
Partially fixed, boxing is not reported now. Will report implicit .ToString() invocation
Both allocations are now reported:
Boxing is eliminated, but implicit .ToString()
call still allocates a new string (at least for BCL's numeric types)
The code
var x = "Hello " + longValue
will show a highlight for boxing of thelongValue
variable. It appears previous compilers would box the value and callString.Concat(object, object)
. Modern compilers will calllongValue.ToString()
and then callString.Concat(string, string)