Why not use parentName.size() > 0?
It is faster.