`this` is non-null here. So you may as well make this a do/while instead of a while/do:

```
Dsymbol *f = this;
do
{
    if (f->isUnitTestDeclaration())
        return true;
    f = f->toParent();
} while (f);
```