Write Python code to implement this logic: if the number is even, then double the value; otherwise, subtract 1 from the value.
def modify_number(number):
   if number % 2 == 0:
       return number * 2
   else:
       return number - 1