Local variables associated to boolean expressions when not needed
Given the code:
DateTime start = DateTime.Today;
DateTIme end = DateTime.Today;
if( !start<=end)
{
...
}
is decompiled as:
DateTime start = DateTime.Today;
DateTIme end = DateTime.Today;
bool flag = !(dataStart >= dataEnd);
if (flag)
{
...
}
2 comments
-
Hi,
Thanks for the feedback. Can you please help us by answering two questions:
1) Can you share which configuration is used to built the assembly you're decompiling - Debug or Release configuration?
2) Can you tell us which version of JustDecompile you're using?
-
mecusorin
commented
i can't edit the initial post, a mistake was maded in the example (the decompiler is not changing the boolean expression, just creates an unneeded variable). So i iterate here the correct example:
Given the code:
DateTime start = DateTime.Today;
DateTime end = DateTime.Today;
if( !start>=end)
{
...
}is decompiled as:
DateTime start = DateTime.Today;
DateTIme end = DateTime.Today;
bool flag = !(start >= end);
if (flag)
{
...
}