Little refactoring

temp = temp[0..min_length] if min_length > 0
return temp
to
(min_length > 0) ? temp[0..min_length] : temp