Rewrite r21464 in a more compact/readable way. Reduces code duplication as well.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27554 a1c6a512-1295-4272-9138-f99709370657
1 file changed