Difference in initialization in C# RRS feed

  • Question

  • i'm not sure if really i'm addressing a performance improvement. i want to address the CA1805 from code analysis. it's stating like this:

    "Warning 146 CA1805 : Microsoft.Performance : <Class.field>() initializes field <string> of type System.String to null. Remove this initialization as it will be done automatically by the runtime."

    and this is the line it is pointing to
    private string <string> = default(string);

    im not very sure if could simply correct this by just doing this:
    private string <string>;

    will there be any difference between the two? hope you can input suggestions.

    Tuesday, September 1, 2009 1:03 PM

All replies

  • i'm not sure if this is a noob thing..but i hope you could reply to my question..

    will there be any difference in declaration stated above..


    Thursday, September 3, 2009 3:42 AM