[Python-Dev] cmp(x,x) (original) (raw)
Gustavo Niemeyer niemeyer at conectiva.com
Tue May 25 11:40:49 EDT 2004
- Previous message: [Python-Dev] cmp(x,x)
- Next message: [Python-Dev] cmp(x,x)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Going through the function, in a case where v is w and op is either PyEQ or PyNE, we have
Looking again, this is true for any operation, not only Py_EQ or Py_NE. So the shortcut might be:
if (v == w) {
if (op == Py_EQ || op == Py_LE || op == Py_GE)
res = Py_True;
else
res = Py_False;
Py_INCREF(res);
return res;
}
-- Gustavo Niemeyer http://niemeyer.net
- Previous message: [Python-Dev] cmp(x,x)
- Next message: [Python-Dev] cmp(x,x)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]