I see some code of some guy that goes like this:
while (!(baseType == typeof(Object)))
{
....
baseType = baseType.BaseType;
if (baseType != null)
continue;
break;
} while (baseType != typeof(Object));
What is while(...) {...} while(...) statement?
is the following equivalent code?
while (baseType != null && baseType != typeof(Object))
{
....
baseType = baseType.BaseType;
}
There is no
while() ... while();statement,so it’s really two while statements, like:When they have the same condition, like in your example, the second one is useless.
Edit:
Actually, doing some testing I came to realise that it’s actually two loops, like: