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.

Author belopolsky
Recipients belopolsky, josiahcarlson, larry, lskovlund, rhettinger
Date 2008-03-24.18:42:51
SpamBayes Score 0.15110435
Marked as misclassified No
Message-id <1206384172.37.0.585512229666.issue1569291@psf.upfronthosting.co.za>
In-reply-to
Content
Looking at stringobject.c:1034:

i = 0;  
if (i < size) {  
        Py_MEMCPY(op->ob_sval, a->ob_sval, Py_SIZE(a));  
        i = Py_SIZE(a);  
}  
while (i < size) {  
        j = (i <= size-i)  ?  i  :  size-i;  
        Py_MEMCPY(op->ob_sval+i, op->ob_sval, j);  
        i += j;  
}  
return (PyObject *) op;

Do I miss something or the first condition "if (i < size)" is
a fancy way to check for size > 0?

Wouldn't it be clearer to write

if (size == 0)
        return (PyObject *) op;
Py_MEMCPY(op->ob_sval, a->ob_sval, Py_SIZE(a)); 
i = Py_SIZE(a);
..
History
Date User Action Args
2008-03-24 18:42:52belopolskysetspambayes_score: 0.151104 -> 0.15110435
recipients: + belopolsky, rhettinger, josiahcarlson, larry, lskovlund
2008-03-24 18:42:52belopolskysetspambayes_score: 0.151104 -> 0.151104
messageid: <1206384172.37.0.585512229666.issue1569291@psf.upfronthosting.co.za>
2008-03-24 18:42:51belopolskylinkissue1569291 messages
2008-03-24 18:42:51belopolskycreate