From: Björn Jacke Date: Sun, 25 Aug 2019 21:04:25 +0000 (+0200) Subject: traffic.py: avoid inefficient string concatenations X-Git-Tag: talloc-2.3.1~723 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c34a2d72569f31d59b904c3ca1c140f6084b3dd;p=thirdparty%2Fsamba.git traffic.py: avoid inefficient string concatenations Signed-off-by: Bjoern Jacke Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index d0a2ffc8f2c..c428b4e369e 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -453,9 +453,7 @@ class ReplayContext(object): # lookup all the GPO DNs res = db.search(db.domain_dn(), scope=ldb.SCOPE_SUBTREE, attrs=['dn'], expression='(objectclass=groupPolicyContainer)') - gpos_by_dn = "" - for msg in res: - gpos_by_dn += "(distinguishedName={0})".format(msg['dn']) + gpos_by_dn = "".join("(distinguishedName={0})".format(msg['dn']) for msg in res) # a search for the 'gPCFileSysPath' attribute is probably a GPO search # (as per the MS-GPOL spec) which searches for GPOs by DN