Skip to content

Commit

Permalink
Skip subject if already added.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbeced committed Jul 28, 2015
1 parent bc8aa0c commit fc27030
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyalgotrade/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def getSubjects(self):
return self.__subjects

def addSubject(self, subject):
assert(subject not in self.__subjects)
# Skip the subject if it was already added.
if subject in self.__subjects:
return

if subject.getDispatchPriority() is None:
self.__subjects.append(subject)
else:
Expand Down

0 comments on commit fc27030

Please sign in to comment.