input: Write a function to optimize the given Python code for filtering elements greater than 2 from a list, using list comprehension for efficiency. The function should take a list as input and return the filtered list.
  assert optimize_filter([1, 2, 3, 4])==[3, 4]
  assert optimize_filter([5, 6, 7])==[5, 6, 7]
  assert optimize_filter([1, 2])==[]
  assert optimize_filter([])==[]
output: def optimize_filter(lst):
      return [x for x in lst if x > 2]