I would reverse the checks so we only have to check the length if it is really necessary.