Optimise in_tag test
Optimise in_tag test

The old in_tag test essentially run a quadratic algorithm to test
whether one of set of tags was currently open.  This can be replaced
with a linear algorithm (assuming constant time dictionary access)
which speeds up the handle_starttag method.

In one test, the method got sped up by over 40%:

           ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    Before: 35946    0.256    0.000    1.265    0.000 parser.py:208(handle_starttag)
    After:  35946    0.232    0.000    0.740    0.000 parser.py:223(handle_starttag)

htmlmin’s test suit itself was sped up by over 10%:

    Before: Ran 82 tests in 0.449s
    After: Ran 82 tests in 0.398s

mankyd/htmlmin,mankyd/htmlmin