Make `makeFolderSortString` more efficient