diff options
author | Alan Conway <aconway@apache.org> | 2007-12-04 19:33:34 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-12-04 19:33:34 +0000 |
commit | e9aabf87ff40c4f9bcbbb37688eae1ba1c1e71e3 (patch) | |
tree | 34b0f268c6039247e9be0ed754d4a821fecf44dd /cpp/src | |
parent | 6f5144ef4cb95252fafdbdba8aa7d9a5b4d2dd76 (diff) | |
download | qpid-python-e9aabf87ff40c4f9bcbbb37688eae1ba1c1e71e3.tar.gz |
Patch from Ted Ross <tross@redhat.com>
I've been doing some work in TopicExchange and noticed an opportunity
for optimization of the route method. The current code does a heap
allocation per binding, per message. The optimization removes the
per-binding allocation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@601051 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/TopicExchange.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/TopicExchange.cpp b/cpp/src/qpid/broker/TopicExchange.cpp index 99c0d381c5..bc761cf34d 100644 --- a/cpp/src/qpid/broker/TopicExchange.cpp +++ b/cpp/src/qpid/broker/TopicExchange.cpp @@ -152,8 +152,9 @@ bool TopicExchange::isBound(Queue::shared_ptr queue, TopicPattern& pattern) void TopicExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* /*args*/){ RWlock::ScopedRlock l(lock); + Tokens tokens(routingKey); for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) { - if (i->first.match(routingKey)) { + if (i->first.match(tokens)) { Queue::vector& qv(i->second); for(Queue::vector::iterator j = qv.begin(); j != qv.end(); j++){ msg.deliverTo(*j); |