Improve interface of generator

the next() method used to compute next generator state does not need to
return a value as it already sets the state. Returning void does not
improve performance, but it's cleaner.