From 4d589859dc18699b2a3b2ad157d0c5533a7a30fd Mon Sep 17 00:00:00 2001 From: "David A. Wheeler" Date: Sat, 23 Sep 2017 20:41:45 -0400 Subject: [PATCH] Change array to tuple Change possible_levels to a tuple. Arrays are mutable, but we never want to mutate this value, so changing it to a tuple reduces the risk of accidentally mutating it. Signed-off-by: David A. Wheeler --- flawfinder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flawfinder b/flawfinder index 58249d4..f32fe3b 100755 --- a/flawfinder +++ b/flawfinder @@ -2013,7 +2013,8 @@ def show_final_results(): count = 0 count_per_level = {} count_per_level_and_up = {} - possible_levels = [0, 1, 2, 3, 4, 5] # Eliminate dependency on range + # Name levels directly, to avoid Python "range" (a Python 2/3 difference) + possible_levels = (0, 1, 2, 3, 4, 5) for i in possible_levels: # Initialize count_per_level count_per_level[i] = 0 for i in possible_levels: # Initialize count_per_level