robertwb / issues-import-test

0 stars 0 forks source link

Bad list constructor code #71

Closed robertwb closed 7 years ago

robertwb commented 7 years ago

Reported by gfurnish on 2 Aug 2008 12:53 UTC Consider:

 405:     _operands = list()

  __pyx_1 = PyObject_Call(((PyObject*)&PyList_Type), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1;}
  Py_DECREF(__pyx_v__operands);
  __pyx_v__operands = __pyx_1;
  __pyx_1 = 0;

This is wildly inefficient compared to a single PyList_New(0) call.

Migrated-From: http://trac.cython.org/ticket/39

robertwb commented 7 years ago

Comment by robertwb on 3 Aug 2008 05:02 UTC Use

_operands = []

instead.

robertwb commented 7 years ago

Modified by robertwb on 19 Aug 2008 04:36 UTC

robertwb commented 7 years ago

Modified by robertwb on 10 Oct 2008 14:57 UTC

robertwb commented 7 years ago

Modified by robertwb on 8 Nov 2008 22:42 UTC