Now that WorkerOffer is a case class, you can do this and the one in makeOffers with the copy idiom:
```scala
workerOffers.keys.foreach { executorId => 
  workerOffers(executorId) = workerOffers(executorId).copy(cores = freeCores(executorId))
}
```