The order of operations seems fine, but consider adding parens here around `([padding] * size)` to better express the intent of this padding function.

Also: is it acceptable that this function can truncate the input sequence or crash if `size` is incorrectly specified? Trivial examples where this argument is very small (or negative!) apply.