This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tiny code polishing to unicode_repeat
Type: Stage:
Components: Interpreter Core Versions: Python 3.1
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, larry
Priority: normal Keywords: patch

Created on 2009-04-06 08:41 by larry, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
lch.unicoderepeat.r71304.diff larry, 2009-04-06 08:41
Messages (2)
msg85620 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2009-04-06 08:41
Two minor tweaks to unicode_repeat:
* If the number of repeats (len) is < 1, we're always going to return
the empty Unicode string.  So I incr and return unicode_empty.
* The current code has "if (done < nchars)" around the first copy.  A
little data-flow analysis of the code will show you that done is always
0 and nchars is always >= str->length.  So the check is
unnecessary--we're always going to do that first copy.  I removed the if
and set done to str->length directly.

Hope I got it right!
msg85896 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-12 12:01
Committed in r71506.
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49958
2009-04-12 12:01:57georg.brandlsetstatus: open -> closed
resolution: accepted
messages: + msg85896
2009-04-07 22:59:39georg.brandlsetassignee: georg.brandl

nosy: + georg.brandl
2009-04-06 08:41:43larrycreate