Use \isempty instead of \equal{...}{\@empty}
This makes the code more readable, but the contents of the test are not expanded, thus a thorough test is needed after changing.
This makes the code more readable, but the contents of the test are not expanded, thus a thorough test is needed after changing.