input: Write a function to optimize the given Python code for efficiency by converting the for loop into a list comprehension. The function should accept a list of integers and return a new list containing only the elements that are greater than 2.
  
  assert optimize_code([1, 2, 3, 4])==[3, 4]
  assert optimize_code([5, 1, 8, 9])==[5, 8, 9]
  assert optimize_code([2, 2, 2, 2])==[]
  assert optimize_code([-1, -2, -3])==[]
  assert optimize_code([])==[]
output: def optimize_code(lst):
      return [x for x in lst if x > 2]