input: Write a function to optimize the given Python code for a more efficient implementation. The function should take a list of integers as input and return a new list containing only the elements that are greater than 2. If the input list is empty, the function should return an empty list.
  
  
  def optimize_code(data):
      return [x for x in data if x > 2]
  
  assert optimize_code([1, 2, 3, 4]) == [3, 4]
  assert optimize_code([1, 2, 4, 6]) == [4, 6]
  assert optimize_code([1, 2, 2, 2]) == []
  assert optimize_code([3, 4, 5]) == [3, 4, 5]
  assert optimize_code([]) == []
  
output: def optimize_code(data):
      return [x for x in data if x > 2]