dotnet / codeformatter

Tool that uses Roslyn to automatically rewrite the source to follow our coding styles
MIT License
1.24k stars 245 forks source link

CodeFormatter should remove redundant field initializers #123

Open bartonjs opened 9 years ago

bartonjs commented 9 years ago
public class CryptoStream
{
    private int _InputBufferIndex = 0;
}

_InputBufferIndex will already have the value 0, the initializer being there doesn't change anything.

ghost commented 8 years ago

Ehh, no - if it's a hot perf path, that's one thing but I don't believe people who choose to be explict so the code reads "I didn't forget to initialize this, I made an explicit decision to initialize it to this value" should be scolded by a code-style tool.