input: Write a function to optimize the given code that filters out elements greater than 2 from the list. The function should return the filtered list. If the input list is empty, the function should return an empty list.
  def optimize_filter(data):
      return [x for x in data if x > 2]
  assert optimize_filter([1, 2, 3, 4])==[3, 4]
  assert optimize_filter([1, 2])==[]
  assert optimize_filter([])==[]
  assert optimize_filter([3, 4, 5, 6])==[3, 4, 5, 6]
  assert optimize_filter([-1, -2, -3, 4])==[4]
output: def optimize_filter(data):
      return [x for x in data if x > 2]