From 93e12f915a083b880cbcc21c2def5efe6bc46cae Mon Sep 17 00:00:00 2001 From: Federico Ficarelli Date: Tue, 15 Mar 2016 11:31:55 +0100 Subject: [PATCH] Removed useless bindings parameter from BrokerState constructor --- kombu/transport/virtual/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kombu/transport/virtual/__init__.py b/kombu/transport/virtual/__init__.py index 59724516..8a4ca289 100644 --- a/kombu/transport/virtual/__init__.py +++ b/kombu/transport/virtual/__init__.py @@ -565,6 +565,7 @@ class Channel(AbstractChannel, base.StdChannel): def queue_unbind(self, queue, exchange=None, routing_key='', arguments=None, **kwargs): + # Remove queue binding: self.state.binding_delete(queue, exchange, routing_key) try: table = self.get_table(exchange) @@ -573,6 +574,8 @@ class Channel(AbstractChannel, base.StdChannel): binding_meta = self.typeof(exchange).prepare_bind( queue, exchange, routing_key, arguments, ) + # TODO: the complexity of this operation is O(number of bindings). + # Should be optimized. Modifying table in place. table[:] = [meta for meta in table if meta != binding_meta] def list_bindings(self):