[Python-checkins] python/dist/src/Python compile.c,2.287,2.288
jhylton@users.sourceforge.net
jhylton@users.sourceforge.net
Thu, 22 May 2003 09:22:35 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv15285
Modified Files:
compile.c
Log Message:
Use macro to get length of list.
Remove comment about how code used to work.
Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.287
retrieving revision 2.288
diff -C2 -d -r2.287 -r2.288
*** compile.c 22 May 2003 15:47:02 -0000 2.287
--- compile.c 22 May 2003 16:22:33 -0000 2.288
***************
*** 4968,4980 ****
int pos = 0;
! if (list)
! if (PyList_SetSlice(list, 0,
! ((PyVarObject*)list)->ob_size, 0) < 0)
return -1;
- /* Yes, the above call CAN fail, even though it's reducing
- the size of the list. The current implementation will
- allocate temp memory equal to the size of the list: this
- is avoidable in this specific case, but probably not
- worth the effort of special-casing it. - JRH */
child = (PySymtableEntryObject *)
PyList_GET_ITEM(ste->ste_children, i);
--- 4968,4974 ----
int pos = 0;
! if (list && PyList_SetSlice(list, 0,
! PyList_GET_SIZE(list), 0) < 0)
return -1;
child = (PySymtableEntryObject *)
PyList_GET_ITEM(ste->ste_children, i);