Use -1 instead of None for no limit
This commit is contained in:
@@ -274,10 +274,10 @@ class StreamSink(StreamMonitor, StreamPause):
|
|||||||
def __init__(self, bus, clock, reset=None, *args, **kwargs):
|
def __init__(self, bus, clock, reset=None, *args, **kwargs):
|
||||||
super().__init__(bus, clock, reset, *args, **kwargs)
|
super().__init__(bus, clock, reset, *args, **kwargs)
|
||||||
|
|
||||||
self.queue_occupancy_limit = None
|
self.queue_occupancy_limit = -1
|
||||||
|
|
||||||
def full(self):
|
def full(self):
|
||||||
if self.queue_occupancy_limit and len(self.queue) >= self.queue_occupancy_limit:
|
if self.queue_occupancy_limit > 0 and len(self.queue) >= self.queue_occupancy_limit:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user