File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,16 +203,16 @@ def _optimize_charset(charset, fixup):
203203 # internal: optimize character set
204204 out = []
205205 outappend = out .append
206- charmap = [False ]* 256
206+ charmap = [0 ]* 256
207207 try :
208208 for op , av in charset :
209209 if op is NEGATE :
210210 outappend ((op , av ))
211211 elif op is LITERAL :
212- charmap [fixup (av )] = True
212+ charmap [fixup (av )] = 1
213213 elif op is RANGE :
214214 for i in range (fixup (av [0 ]), fixup (av [1 ])+ 1 ):
215- charmap [i ] = True
215+ charmap [i ] = 1
216216 elif op is CATEGORY :
217217 # XXX: could append to charmap tail
218218 return charset # cannot compress
@@ -298,17 +298,17 @@ def _optimize_unicode(charset, fixup):
298298 import array
299299 except ImportError :
300300 return charset
301- charmap = [False ]* 65536
301+ charmap = [0 ]* 65536
302302 negate = 0
303303 try :
304304 for op , av in charset :
305305 if op is NEGATE :
306306 negate = 1
307307 elif op is LITERAL :
308- charmap [fixup (av )] = True
308+ charmap [fixup (av )] = 1
309309 elif op is RANGE :
310310 for i in xrange (fixup (av [0 ]), fixup (av [1 ])+ 1 ):
311- charmap [i ] = True
311+ charmap [i ] = 1
312312 elif op is CATEGORY :
313313 # XXX: could expand category
314314 return charset # cannot compress
You can’t perform that action at this time.
0 commit comments