Message278398
The cost is really small (an integer compare vs memory malloc and copy). The advantages are fast path for empty strings and retaining consistency with other codes in unicodeobject.c. You can see other places use the same optimization, e.g. PyUnicode_FromUnicode, PyUnicode_FromUCS1, and some functions using unicode_result. |
|
Date |
User |
Action |
Args |
2016-10-10 02:44:22 | xiang.zhang | set | recipients:
+ xiang.zhang, vstinner, serhiy.storchaka |
2016-10-10 02:44:22 | xiang.zhang | set | messageid: <1476067462.82.0.40507848437.issue28398@psf.upfronthosting.co.za> |
2016-10-10 02:44:22 | xiang.zhang | link | issue28398 messages |
2016-10-10 02:44:22 | xiang.zhang | create | |
|