The code will or may break or misbehave for unfortunate enough pathnames. Not for the pathnames in question (at least with standard IFS), but in general: for pathnames with leading hyphen, pathnames containing spaces or characters that trigger globbing. In general this unquoted
$() is not a good practice, unless one really knows what he or she is doing. For the pathnames in question the code seems enough and not overcomplicated (a virtue), still future readers of this answer who may want to use it with unfortunate pathnames should be warned.