From 6f00987850d1789bf342fea79cfb189317f4c9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Thu, 18 Aug 2011 23:33:14 +0200 Subject: Optimized single character check --- libmproxy/contrib/pyparsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmproxy/contrib/pyparsing.py b/libmproxy/contrib/pyparsing.py index e0457f15..496ace54 100644 --- a/libmproxy/contrib/pyparsing.py +++ b/libmproxy/contrib/pyparsing.py @@ -3402,7 +3402,7 @@ def _makeTags(tagStr, xml): Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \ Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") else: - printablesLessRAbrack = "".join(c for c in printables if c not in ">") + printablesLessRAbrack = "".join(c for c in printables if c != ">") tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack) openTag = Suppress("<") + tagStr + \ Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \ -- cgit v1.2.3