Given this source code

C# source:
 public bool IsIndexed {
  get { return (SearchFlags & (int)
AttributeSearchFlags.Index) != 0; }
 }


why is the comparison to 0 done twice?



Anakrino decompilation:
public bool get_IsIndexed() {
 return this.SearchFlags & 1 == 0 == 0;
}


ILDASM decompilation:
{
  // Code size       15 (0xf)
  .maxstack  2
  IL_0000:  ldarg.0
  IL_0001:  call       instance int32
SimmoTech.ActiveDirectory.ADAttributeSchema::get_SearchFlags()
  IL_0006:  ldc.i4.1
  IL_0007:  and
  IL_0008:  ldc.i4.0
  IL_0009:  ceq
  IL_000b:  ldc.i4.0
  IL_000c:  ceq
  IL_000e:  ret
} // end of method ADAttributeSchema::get_IsIndexed

Reply via email to