You can merge two if blocks like follows:

```cpp
        if (e->type->ty == Taarray)
            s = ((TypeAArray *)e->type)->getImpl();
        else
            s = e->type->toDsymbol(NULL);
        if (s)
        {
            s = s->search(loc, ident, 0);
            if (s)
                return s;
        }
```