Exemplo n.º 1
0
        /// <inheritdoc />
        public override void VisitMethodCall(MethodCall call)
        {
            base.VisitMethodCall(call);

            string resolutionName;

            if (call.IsCall(SystemMembers.Enumerable_Count) && IsUnnecessaryCall(call, out resolutionName))
            {
                Problems.Add(CreateProblem(resolutionName, call));
            }
        }
Exemplo n.º 2
0
 /// <inheritdoc />
 protected override bool IsSecondTargetMethodCall(MethodCall call)
 {
     return(call.IsCall(SystemMembers.IDictionary_Indexer.Getter));
 }
Exemplo n.º 3
0
 /// <inheritdoc />
 protected override bool IsFirstTargetMethodCall(MethodCall call)
 {
     return(call.IsCall(SystemMembers.IDictionary_ContainsKey));
 }
Exemplo n.º 4
0
 /// <inheritdoc />
 protected override bool IsSecondTargetMethodCall(MethodCall call)
 {
     return(call.IsCall(SystemMembers.Enumerable_First) || call.IsCall(SystemMembers.Enumerable_FirstOrDefault));
 }
Exemplo n.º 5
0
 /// <inheritdoc />
 protected override bool IsFirstTargetMethodCall(MethodCall call)
 {
     return(call.IsCall(SystemMembers.Enumerable_Any));
 }