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
|
||||||
|
|
Reference in New Issue
Block a user