input: Write a function to optimize the given Python program to print each number in a list on a new line. The function should modify the input list and print the numbers efficiently. If the list is empty, the function should print nothing.
  assert optimize_print([1, 2, 3, 4, 5, 6])=="1\n2\n3\n4\n5\n6"
  assert optimize_print([])==None
  assert optimize_print([10, 20, 30])=="10\n20\n30"
output: def optimize_print(lst):
      if lst:
          return '\n'.join(map(str, lst))