I also think it would be nice to make that a separate function.
Maybe something like ConditionalFlush().
We have too many instances where adding a true or false to a function as a argument makes it do something that isn't immediately obvious.