You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Florian Weimer <fw...@redhat.com> on 2012/05/16 15:09:38 UTC
Concerns about qpid::framing::Buffer::Iterator
Hi,
the definition of qpid::framing::Buffer::Iterator seems buggy to me.
This is not a bidirectional iterator. It's not even a forward iterator
because the iterator state is kept in the referenced buffer object. It
is not possible to use a pair of such iterators to form a range, so not
many algorithms can be used on them (at least not in a safe manner).
Consequently, I don't think this class is very useful. Perhaps it can
be removed together with the Buffer::getIterator() method?
Florian
--
Florian Weimer / Red Hat Product Security Team
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
Re: Concerns about qpid::framing::Buffer::Iterator
Posted by Andrew Stitcher <as...@redhat.com>.
On Wed, 2012-05-16 at 15:09 +0200, Florian Weimer wrote:
> Hi,
>
> the definition of qpid::framing::Buffer::Iterator seems buggy to me.
> This is not a bidirectional iterator. It's not even a forward iterator
> because the iterator state is kept in the referenced buffer object. It
> is not possible to use a pair of such iterators to form a range, so not
> many algorithms can be used on them (at least not in a safe manner).
>
> Consequently, I don't think this class is very useful. Perhaps it can
> be removed together with the Buffer::getIterator() method?
I agree with this -
>From a quick git grep of the source code the Iterator is only used in
cpp/src/qpid/framing/AMQCommandControlBody.h. And it seems that
AMQCommandControlBody.h is not used anywhere in the source! (Again
according to git grep) So it seems that we could just remove this code
entirely.
On a side note - We do seem to have a certain amount of dead code
hanging around ripe for deletion.
Perhaps open a Jira so that we can track this issue? Assign it to me if
you like.
Thanks for looking at this.
Andrew
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org