simplify padding calc by avoiding redundant len() call
Merge pull request #4656 from hulu/simplify-padding-calculation

Simplify padding calculation by avoiding redundant `len()` call.