summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-04 19:33:34 +0000
committerAlan Conway <aconway@apache.org>2007-12-04 19:33:34 +0000
commitb49a2d078652349b0f34936a567a1fe968bcdc07 (patch)
tree17d13c1d71943bd09bc8308c9c7146f75ba0e4ce
parent0ba3c58e27ee759930a01e42112f79dcb5069312 (diff)
downloadqpid-python-b49a2d078652349b0f34936a567a1fe968bcdc07.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@601051 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/TopicExchange.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/TopicExchange.cpp b/qpid/cpp/src/qpid/broker/TopicExchange.cpp
index 99c0d381c5..bc761cf34d 100644
--- a/qpid/cpp/src/qpid/broker/TopicExchange.cpp
+++ b/qpid/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);