python3: fix incorrect use of merging two dictionaries

In python2, this was inefficient, because it allocated *three* lists of
tuples, before finally generating a dict based on them. In python3, it
fails because you cannot combine the dict_items() type.

Moreover, retval was always a function-local dictionary used purely for
returning the value, so dict1.update(dict2) will always yield the
correct result, and we don't even need to create a copy to avoid
mutating the original dictionary.
This commit is contained in:
Eli Schwartz 2019-12-16 16:33:38 -05:00 committed by Jim Miller
parent dc77754c1a
commit a2c558d864

View file

@ -491,7 +491,8 @@ class AddNewDialog(SizePersistedDialog):
retval['updatemeta']=True retval['updatemeta']=True
retval['collision']=ADDNEW retval['collision']=ADDNEW
return dict(retval.items() + self.extraoptions.items() ) retval.update(self.extraoptions)
return retval
def get_urlstext(self): def get_urlstext(self):
return unicode(self.url.toPlainText()) return unicode(self.url.toPlainText())