<Type Name="CompareWithEmptyStringEfficientlyRule" FullName="Gendarme.Rules.Performance.CompareWithEmptyStringEfficientlyRule">
  <TypeSignature Language="C#" Value="public class CompareWithEmptyStringEfficientlyRule : Gendarme.Framework.Rule, Gendarme.Framework.IMethodRule" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit CompareWithEmptyStringEfficientlyRule extends Gendarme.Framework.Rule implements class Gendarme.Framework.IMethodRule, class Gendarme.Framework.IRule" />
  <AssemblyInfo>
    <AssemblyName>Gendarme.Rules.Performance</AssemblyName>
    <AssemblyVersion>2.11.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>Gendarme.Framework.Rule</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>Gendarme.Framework.IMethodRule</InterfaceName>
    </Interface>
  </Interfaces>
  <Attributes>
    <Attribute>
      <AttributeName>Gendarme.Framework.EngineDependency(typeof(Gendarme.Framework.Engines.OpCodeEngine))</AttributeName>
    </Attribute>
    <Attribute>
      <AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Performance", "CA1820:TestForEmptyStringsUsingStringLength")</AttributeName>
    </Attribute>
    <Attribute>
      <AttributeName>Gendarme.Framework.Problem("This method compares a string with an empty string by using the Equals method or the equality (==) or inequality (!=) operators.")</AttributeName>
    </Attribute>
    <Attribute>
      <AttributeName>Gendarme.Framework.Solution("Compare String.Length with 0 instead. The string length is known and it's faster to compare integers than to compare strings.")</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <summary>
            This rule will fire if a string is compared to <c>""</c> or <c>String.Empty</c>.
            Instead use a <c>String.Length</c> test which should be a bit faster. Another
            possibility (with .NET 2.0) is to use the static <c>String.IsNullOrEmpty</c> method.
            <c>String.IsNullOrEmpty</c>.
            </summary>
    <remarks>To be added.</remarks>
    <example>
            Bad example:
            <code>
            public void SimpleMethod (string myString)
            {
            	if (myString.Equals (String.Empty)) {
            	}
            }
            </code></example>
    <example>
            Good example:
            <code>
            public void SimpleMethod (string myString)
            {
            	if (myString.Length == 0) {
            	}
            }
            </code></example>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public CompareWithEmptyStringEfficientlyRule ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.11.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="CheckMethod">
      <MemberSignature Language="C#" Value="public Gendarme.Framework.RuleResult CheckMethod (Mono.Cecil.MethodDefinition method);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype Gendarme.Framework.RuleResult CheckMethod(class Mono.Cecil.MethodDefinition method) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.11.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Gendarme.Framework.RuleResult</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="method" Type="Mono.Cecil.MethodDefinition" />
      </Parameters>
      <Docs>
        <param name="method">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
