input: Write a function to optimize the given Python code that removes duplicates from an array using built-in functions. If the input array is empty, it should return an empty array.
  
  def removeDuplicates(array): 
      return list(dict.fromkeys(array)) if array else []
  
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([1, 1, 1, 1])==[1]
  assert removeDuplicates([])==[]
  assert removeDuplicates([5, 5, 6, 6, 7, 7, 7, 8])==[5, 6, 7, 8]
  assert removeDuplicates([10, 20, 30, 20, 10, 40])==[10, 20, 30, 40]
output: def removeDuplicates(array): 
      return list(dict.fromkeys(array)) if array else []