]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Speedup str[a:b] and PyUnicode_FromKindAndData
authorVictor Stinner <vstinner@wyplay.com>
Wed, 5 Oct 2011 12:01:42 +0000 (14:01 +0200)
committerVictor Stinner <vstinner@wyplay.com>
Wed, 5 Oct 2011 12:01:42 +0000 (14:01 +0200)
commitb9275c104e50361fe3a785126e5ecad24d319a7a
treed901fac5c205332619a42c186063dd269261aedd
parent702c7343957ec4369e89e738fdd157a435f2461f
Speedup str[a:b] and PyUnicode_FromKindAndData

 * str[a:b] doesn't scan the string for the maximum character if the string
   is ascii only
 * PyUnicode_FromKindAndData() stops if we are sure that we cannot use a
   shorter character type. For example, _PyUnicode_FromUCS1() stops if we
   have at least one character in range U+0080-U+00FF
Include/unicodeobject.h
Objects/unicodeobject.c