From: Greg Bedwell Date: Thu, 4 Oct 2018 14:42:06 +0000 (+0000) Subject: [utils] simple refactor in update_mca_test_checks.py to make intent more readable X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4e0ab3a22c52754522c264b9885f75d1ebe698b;p=platform%2Fupstream%2Fllvm.git [utils] simple refactor in update_mca_test_checks.py to make intent more readable llvm-svn: 343782 --- diff --git a/llvm/utils/update_mca_test_checks.py b/llvm/utils/update_mca_test_checks.py index 6454164..c1f89e0 100755 --- a/llvm/utils/update_mca_test_checks.py +++ b/llvm/utils/update_mca_test_checks.py @@ -492,21 +492,20 @@ def _write_output(test_path, input_lines, prefix_list, block_infos, # noqa output_check_lines = [] used_prefixes = set() for block_num in range(len(block_infos)): - for block_text in sorted(block_infos[block_num]): - if not block_text: - continue + if type(block_infos[block_num]) is list: + # The block is of the type output from _break_down_block(). + used_prefixes |= _write_block(output_check_lines, + block_infos[block_num], + not_prefix_set, + common_prefix, + prefix_pad) + else: + # _break_down_block() was unable to do do anything so output the block + # as-is. + for block_text in sorted(block_infos[block_num]): + if not block_text: + continue - if type(block_infos[block_num]) is list: - # The block is of the type output from _break_down_block(). - used_prefixes |= _write_block(output_check_lines, - block_infos[block_num], - not_prefix_set, - common_prefix, - prefix_pad) - break - elif block_infos[block_num][block_text]: - # _break_down_block() was unable to do do anything so output the block - # as-is. lines = block_text.split('\n') for prefix in block_infos[block_num][block_text]: used_prefixes |= _write_block(output_check_lines,