On Fri, Dec 04, 2009 at 04:03:44AM +0100, [email protected] wrote:
> This is an abuse of updateLabels(), in a way, but updateLabels() long
> ago became the general recurse-through-the-Buffer routine, and to
> implement the sort of thing I want to do here in validate(), say, much
> of the code in updateLabels()---in particular, the counter-update
> code---would have to be duplicated. So I believe this is the best, and
> easiest, way to go.
I am not really a fan of "random" boolean arguments, with default value
even tacked onto "unrelated" functions. Is this really necessary?
> -void Buffer::updateLabels(UpdateScope scope) const
> +void Buffer::updateLabels(bool out, UpdateScope scope) const
[...]
> -void Buffer::updateLabels(ParIterator & parit) const
> +void Buffer::updateLabels(ParIterator & parit, bool out) const
Having the 'bool' argument once as first and once as second parameter
does not really help to memorize their usage.
I am not saying this is wrong, just eye-catching.
void updateLabels() const { updateLabels(UpdateMaster, false); }
void updateLabels(UpdateScope scope, bool output = false) const;
void updateLabels(ParIterator & parit, bool output = false) const;
seems slightly less evil. Perhaps even
void updateLabels() const { updateLabels(UpdateMaster, false); }
void updateLabels(UpdateScope scope, bool output) const;
void updateLabels(ParIterator & parit, bool output) const;
is possible.
Andre'