simplify padding calculation by avoiding redundant len() call