C# if statement. inner workings Q
- by Mike Mengell
I've just come across this code snippet in some Exchange 2010 code and I was wondering if anyone knew why the programmer has done it this way. I've never seen an If statement formatted like this. It seems so backwards there must be a good reason for it??
if (true == MsgItem.HasAttachments)
{
// Code
}
I'm assuming it might have some optimisation over the various other ways of coding the same thing;
if (MsgItem.HasAttachments)
{
// Code
}
or
if (MsgItem.HasAttachments == true)
{
// Code
}
Its not a big deal I'm just curious.
Thanks,
Mike