input: Write a function to optimize the given Python code to use built-in functions for removing duplicates from an array. If the given array is empty then return an empty array.
  
  def removeDuplicates(array):
      return list(dict.fromkeys(array))
  
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([10, 20, 30, 20, 40])==[10, 20, 30, 40]
  assert removeDuplicates([7, 7, 7, 7, 7])==[7]
  assert removeDuplicates([1, 3, 2, 5, 4])==[1, 3, 2, 5, 4]
  assert removeDuplicates([])==[]
output: def removeDuplicates(array):
      return list(dict.fromkeys(array))