roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

Feature Request: TryGetValue with discard out parameter

Open wiz0u opened this issue 6 years ago • 0 comments
trafficstars

An analyzer could detect this pattern: dictionary.TryGetValue(key, out var _) and suggest to turn it to dictionary.ContainsKey(key)

This can possibly be extended to other similar methods in the .NET Framework which have better equivalent if you discard the out parameter) (and not just TryGetValue methods, possibly other signature as well..)

wiz0u avatar May 14 '19 15:05 wiz0u