Message36588
Logged In: YES
user_id=31435
Marked accepted. Looks good!
Suggest
return a->ob_size == b->ob_size &&
*a->ob_sval == *b->ob_sval &&
memcmp(a->ob_sval, b->ob_sval, a->ob_size) == 0;
for the tail of the _PyString_Eq body as compilers should
have an easier time of turning that into the best code for
the platform (especially the weaker compilers do better
optimizing expressions than across branches). Plus it
improves clarity, at least for me.
Unsure why the
case Py_EQ: c = c == 0; break; /* not needed here */
case is there: if it's truly unreacable (and I agree it
isn't), better to assert-fail if it gets there. |
|
Date |
User |
Action |
Args |
2007-08-23 15:05:43 | admin | link | issue424335 messages |
2007-08-23 15:05:43 | admin | create | |
|