]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool domain: Remove unnecessary variable
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 13 Feb 2023 01:53:54 +0000 (14:53 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 16 May 2023 23:29:32 +0000 (23:29 +0000)
It is conciser to use â€˜r’ to refer to update_forest_info.entries[i].

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain/trust.py

index d20ccee0b5b4bebbf64ee4eeeae7982c08275780..a9fb4ef66048908000970a4adae6e63e4975f991 100644 (file)
@@ -2126,21 +2126,21 @@ class cmd_domain_trust_namespaces(DomainTrustCommand):
         update_forest_info.entries = entries
 
         if enable_all:
-            for i, r in enumerate(update_forest_info.entries):
+            for r in update_forest_info.entries:
                 if r.type != lsa.LSA_FOREST_TRUST_TOP_LEVEL_NAME:
                     continue
-                if update_forest_info.entries[i].flags == 0:
+                if r.flags == 0:
                     continue
-                update_forest_info.entries[i].time = 0
-                update_forest_info.entries[i].flags &= ~lsa.LSA_TLN_DISABLED_MASK
-            for i, r in enumerate(update_forest_info.entries):
+                r.time = 0
+                r.flags &= ~lsa.LSA_TLN_DISABLED_MASK
+            for r in update_forest_info.entries:
                 if r.type != lsa.LSA_FOREST_TRUST_DOMAIN_INFO:
                     continue
-                if update_forest_info.entries[i].flags == 0:
+                if r.flags == 0:
                     continue
-                update_forest_info.entries[i].time = 0
-                update_forest_info.entries[i].flags &= ~lsa.LSA_NB_DISABLED_MASK
-                update_forest_info.entries[i].flags &= ~lsa.LSA_SID_DISABLED_MASK
+                r.time = 0
+                r.flags &= ~lsa.LSA_NB_DISABLED_MASK
+                r.flags &= ~lsa.LSA_SID_DISABLED_MASK
 
         for tln in enable_tln:
             idx = None