Removed useless bindings parameter from BrokerState constructor

This commit is contained in:
Federico Ficarelli 2016-03-15 11:31:55 +01:00 committed by Ask Solem
parent 7bfcb3a673
commit 93e12f915a
1 changed files with 3 additions and 0 deletions

View File

@ -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):