As the comment specifies, using len() is intentional there and likely saving queries.