The documentation of determineactions() mention that it is given a list
returned from findoptimizations() however it was not true before this patch.
The code extending actions with optimizations also mentioned about it that this
should be in determineactions.
So let's do what comments at couple of places say.