Reduce list <-> set conversions
This commit is contained in:
parent
1973093082
commit
d295049653
|
@ -1995,13 +1995,12 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
|
|
||||||
# To send a message to specific people (rather than broadcast)
|
# To send a message to specific people (rather than broadcast)
|
||||||
if sendMessageToPeople:
|
if sendMessageToPeople:
|
||||||
toAddressesList = [
|
toAddressesList = set([
|
||||||
s.strip() for s in toAddresses.replace(',', ';').split(';')
|
s.strip() for s in toAddresses.replace(',', ';').split(';')
|
||||||
]
|
])
|
||||||
# remove duplicate addresses. If the user has one address
|
# remove duplicate addresses. If the user has one address
|
||||||
# with a BM- and the same address without the BM-, this will
|
# with a BM- and the same address without the BM-, this will
|
||||||
# not catch it. They'll send the message to the person twice.
|
# not catch it. They'll send the message to the person twice.
|
||||||
toAddressesList = list(set(toAddressesList))
|
|
||||||
for toAddress in toAddressesList:
|
for toAddress in toAddressesList:
|
||||||
if toAddress != '':
|
if toAddress != '':
|
||||||
# label plus address
|
# label plus address
|
||||||
|
@ -2248,7 +2247,7 @@ class MyForm(settingsmixin.SMainWindow):
|
||||||
'''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t)
|
'''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t)
|
||||||
|
|
||||||
toLabel = str_broadcast_subscribers
|
toLabel = str_broadcast_subscribers
|
||||||
|
|
||||||
self.displayNewSentMessage(
|
self.displayNewSentMessage(
|
||||||
toAddress, toLabel, fromAddress, subject, message, ackdata)
|
toAddress, toLabel, fromAddress, subject, message, ackdata)
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user