From 477d02bbe7f2cfee8347c8c434961c49f458b337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 27 Jan 2016 15:30:10 +0100 Subject: [PATCH] reduce: fix [ci skip] --- tools/reduce.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/reduce.py b/tools/reduce.py index c099d5a6e..f3c3bd99d 100644 --- a/tools/reduce.py +++ b/tools/reduce.py @@ -178,7 +178,7 @@ def removeblocks(filedata): i2 = i1 indent = 0 - while i2 < len(filedata) and indent>=0: + while i2 < len(filedata): for c in filedata[i2]: if c == '}': indent = indent - 1 @@ -186,6 +186,8 @@ def removeblocks(filedata): indent = -100 elif c == '{': indent = indent + 1 + if indent < 0: + break i2 = i2 + 1 if indent == -100: indent = 0