From d29504965309efb72063aaee2d9b4e89bb881971 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 26 Feb 2018 13:34:10 +0200 Subject: [PATCH] Reduce list <-> set conversions --- src/bitmessageqt/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 3e181dae..93f1a100 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1995,13 +1995,12 @@ class MyForm(settingsmixin.SMainWindow): # To send a message to specific people (rather than broadcast) if sendMessageToPeople: - toAddressesList = [ + toAddressesList = set([ s.strip() for s in toAddresses.replace(',', ';').split(';') - ] + ]) # remove duplicate addresses. If the user has one address # with a BM- and the same address without the BM-, this will # not catch it. They'll send the message to the person twice. - toAddressesList = list(set(toAddressesList)) for toAddress in toAddressesList: if toAddress != '': # label plus address @@ -2248,7 +2247,7 @@ class MyForm(settingsmixin.SMainWindow): '''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t) toLabel = str_broadcast_subscribers - + self.displayNewSentMessage( toAddress, toLabel, fromAddress, subject, message, ackdata)