I wrote this piece of code:
private Queue<int> EnsureQueue() { return _queue ?? (_queue = new Queue<int>(10)); }
and the reflector gives me:
private Queue<int> EnsureQueue() { if (this._queue == null) { } return (this._queue = new Queue<int>(10)); }
Obviously, this is not what the source code says. String (this._queue = new Queue<int>(10)); will always return new Queue<int>(10) instead of _queue if it is not null .
Is this a bug in .NET .NET Reflector or am I missing something? The program seems to behave correctly ...
EDIT -> See My Answer
source share