Skip to content

Commit 6946391

Browse files
Use "if x not in y" instead of discouraged "if not x in y".
1 parent 4da9447 commit 6946391

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

utils/apply-fixit-edits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def apply_edits(path):
4848
edits_per_file = {}
4949
for ed in edits_set:
5050
fname = ed[0]
51-
if not fname in edits_per_file:
51+
if fname not in edits_per_file:
5252
edits_per_file[fname] = []
5353
edits_per_file[fname].append((ed[1], ed[2], ed[3]))
5454

utils/cmpcodesize/cmpcodesize/compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def addFunction(sizes, function, startAddr, endAddr, groupByPrefix):
5050
if groupByPrefix:
5151
for infix in SortedInfixes:
5252
if infix in function:
53-
if not GenericFunctionPrefix in function:
53+
if GenericFunctionPrefix not in function:
5454
sizes[Infixes[infix]] += size
5555
return
5656
for prefix in SortedPrefixes:

utils/pass-pipeline/scripts/pipeline_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
disabled_passpipelines = sum(args.disable_passpipeline, [])
3131

3232
# First filter out pipelines.
33-
normal_pipeline_generated = [x.generate() for x in normal_pipeline if not x.identifier in disabled_passpipelines]
33+
normal_pipeline_generated = [x.generate() for x in normal_pipeline if x.identifier not in disabled_passpipelines]
3434

3535
# Then filter out specific passes.
3636
for i in range(len(normal_pipeline_generated)):

utils/viewcfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def main():
121121
newBlocks = { }
122122
for name, block in blocks.iteritems():
123123
for adjName in (block.preds + block.getSuccs()):
124-
if not adjName in blocks:
124+
if adjName not in blocks:
125125
newBlocks[adjName] = Block(adjName, None)
126126

127127
blocks = dict(blocks.items() + newBlocks.items())
@@ -132,7 +132,7 @@ def main():
132132
for name, block in blocks.iteritems():
133133
for predName in block.preds:
134134
predBlock = blocks[predName]
135-
if not name in predBlock.getSuccs():
135+
if name not in predBlock.getSuccs():
136136
predBlock.getSuccs().append(name)
137137

138138
# Write the output dot file.

0 commit comments

Comments
 (0)