qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@redhat.com>
Subject I think this code is unnecessary...
Date Fri, 01 Feb 2013 16:45:12 GMT
In SemanticState.cpp:384


bool SemanticStateConsumerImpl::filter(const Message& msg)
{
    return !selector || selector->filter(msg);
}

bool SemanticStateConsumerImpl::accept(const Message& msg)
{
    // TODO aconway 2009-06-08: if we have byte & message credit but
    // checkCredit fails because the message is to big, we should
    // remain on queue's listener list for possible smaller messages
    // in future.
    //
    blocked = !(filter(msg) && checkCredit(msg));
    return !blocked;
}


-- Note that accept() itself uses filter().

However as far as I can tell the only use for this accept() is currently
in Queue.cpp:386


...
            if (c->filter(*msg)) {
                if (c->accept(*msg)) {
                    if (c->preAcquires()) {
...


So it seems that accept() can only be called when filter already
returned true, so trying it again seems unnecessary.

Did I miss some important point here? I'd like to get rid of unnecessary
filter() operations as if a selector is attached they could be costly.

Andrew



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message