As I understand, rule S6605 suggests the use of the collection-specific "Exists" method for performance reasons. It becomes a problem when the "Any" extension method is used in an expression because switching to the "Exists" method changes the expression (e. g. the C# MongoDb Driver supports Any but not Exists). There are also no performance benefits unless the expression is compiled and executed which should not be done anyways when performance is important.
Repro stepsExpression<Func<List<int>, bool>> containsThree = list => list.Any(el => el == 3);
The rule should not fire.
Actual behaviorThe rule fires.
Related informationRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4