Changeset 2846:8220e5086923 in livinglogic.python.xist

Show
Ignore:
Timestamp:
08/03/07 15:43:04 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Another small speed optimization.

Initialize count only once (it needs to increase monotonically
for each XML node).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/ns/html.py

    r2845 r2846  
    14931493            rules.append((selector.cssweight(), selector, rule)) 
    14941494    rules.sort(key=operator.itemgetter(0)) 
     1495    count = 0 
    14951496    for path in node.walk(xsc.Element): 
    14961497        del path[-1][_isstyle] # drop style sheet nodes 
    14971498        if path[-1].Attrs.isallowed("style"): 
    14981499            styles = {} 
    1499             count = 0 
    15001500            for (weight, selector, rule) in iterstyles(path[-1], rules): 
    15011501                if selector.match(path):