# HG changeset patch # User Oleg Oshmyan # Date 1294350811 -7200 # Node ID 007f7eb6fb2bfcd85a4735501acfc8a883a4219e # Parent aea4fc87698ac26b44e88e93934aa3c9059d1104 The test context stack is now a deque. Deques have a faster pop() than lists do. diff -r aea4fc87698a -r 007f7eb6fb2b problem.py --- a/problem.py Thu Jan 06 20:06:42 2011 +0200 +++ b/problem.py Thu Jan 06 23:53:31 2011 +0200 @@ -15,6 +15,11 @@ import os, re, sys try: + from collections import deque +except ImportError: + deque = list + +try: import signal except ImportError: signalnames = () @@ -103,7 +108,7 @@ def test(prob): case = None try: - contexts = [TestGroup()] + contexts = deque((TestGroup(),)) for case in prob.testcases: if case is test_context_end: for case, correct, granted in contexts.pop().end():